Page MenuHomePhabricator

enclose="none" clashes with the Wiki markup for lists
Closed, ResolvedPublic


Author: dpld

Lines starting with #, * or : disrupt GeSHi blocks if the enclose="none" option is deployed. An illustration of the bug can be seen at

There, the first two lines inside the GeSHi block are Matlab comments, which start with #. Before the second line, however, the formatting and syntax highlight are disabled, and a numbered list item is displayed at the comment line. Inspection of the page source reveals the enclosing <span class="mw-geshi matlab source-matlab"> is prematurely closed before the second line. The problem only happens when enclose="none" is used.

See Also:
T14974: The newline added to a template, magic word, variable, or parser function that returns line-start wikicode formatting (*#:; {|) causes unexpected parsing

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:59 PM
bzimport added a project: SyntaxHighlight.
bzimport set Reference to bz23674.
bzimport added a subscriber: Unknown Object (MLST).

I added a simpler test case to

In that page the

<syntaxhighlight lang="matlab" enclose="none">
# foo
# bar
# baz

is parsed to

<p><span class="mw-geshi matlab source-matlab"># foo<br></span></p>
<li><span class="mw-geshi matlab source-matlab"><span class="kw2">bar</span><br></span></li>

and I suspect the brokenness of the first item ("# foo") is related to T14974. Someone with a better understanding of the Parser should check if this bug is a duplicate of that one.

Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).

Still a problem with Pygments

Change 221740 had a related patch set uploaded (by Bartosz Dziewoński):
Use 'nowiki' strip marker for <syntaxhighlight/> output

Change 221740 abandoned by Bartosz Dziewoński:
Use 'nowiki' strip marker for <syntaxhighlight/> output

This is a very clever idea but probably not something we want to maintain. T104067 should be fixable using a variant of this solution described by Brad on the changeset. I'll implement it and submit as a new patch.

Change 221980 had a related patch set uploaded (by Bartosz Dziewoński):
Refactor final output formatting

Change 221980 merged by jenkins-bot:
Refactor final output formatting

matmarex added a subscriber: matmarex.

Since enclose="none" now results in the output being wrapped in <code/> tags this will probably no longer look as intended originally, but the bug as filed is fixed.