Follow TV Tropes

Following

Parser bug: boldface/italics

Go To

Prfnoff Since: Jan, 2001
#1: Jun 1st 2013 at 12:03:33 PM

The parser seems to get confused when parsing lines that have multiple instances of boldface combined with italics.

Markup: '''''Sometimes''' markup works'' and '''''sometimes''' markup doesn't''.
Parsed as HTML: <em><strong>Sometimes<strong> markup works<em> and </strong></em>sometimes</strong> markup doesn't</em>.

Nocturna Since: May, 2011
#2: Jun 1st 2013 at 2:10:12 PM

You have to mark each type of markup (bold, italics, or both) separately. Like so:

Sometimes markup works and sometimes markup doesn't.
'''''Sometimes''''' ''markup works'' and '''''sometimes''''' ''markup doesn't''.

I'm pretty sure the wiki parses the number of apostrophes as a discrete set (e.g. 2, 3, or 5, not 2, 3, and 2+3), and if it finds conflicting information (such as the markup for bold following the markup for bold+italics with no closing for the latter), it just ignores everything. The way it parsed into html supports my supposition.

edited 1st Jun '13 2:14:43 PM by Nocturna

Stratadrake Dragon Writer Since: Oct, 2009
Dragon Writer
#3: Jun 2nd 2013 at 6:26:41 AM

Let me try:

  • Markup: '''''Sometimes''' markup works'' and '''''sometimes''' markup doesn't''.
  • Correct result: Sometimes markup works and sometimes markup doesn't.
  • Actual result: Sometimes markup works and sometimes markup doesn't.

  • Actual result HTML: <em><strong>Sometimes<strong> markup works<em> and </em></strong>sometimes</strong> markup doesn't</em>
  • Correct result HTML: <em><strong>Sometimes</strong> markup works</em> and <em><strong>sometimes</strong> markup doesn't</em>

Note how it's trying to open a second set of bold or italics instead of closing the first one.

Yeah, my guess is that since there is a pair of five-apostrophes (bold+italics), the wiki engine parses that first as a set before it begins parsing triple-apostrophes (bold) and double-apostrophes (italic). Five-apostrophes is not an actual markup entity of its own, it is only supposed to mean a combination of bold markup and italic markup. Do note how this results in incorrectly nested HTML.

In cases where there is only one five-apostrophes (not a pair) in one line, the wiki engine fails to find a "closing tag" so then it proceeds to parse bold then italic (which is the correct behavior).

edited 2nd Jun '13 6:39:43 AM by Stratadrake

An Ear Worm is like a Rickroll: It is never going to give you up.
SeptimusHeap from Switzerland (Edited uphill both ways) Relationship Status: Mu
#4: Jun 2nd 2013 at 6:33:22 AM

I once remember seeing a post in the Complete Monster cleanup topic where 32 Footsteps had forgot a '. There, the entire markup effects shifted.

"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." - Richard Feynman
Add Post

Total posts: 4
Top