Last modified: 2012-04-11 22:49:09 UTC
GeSHi puts a div tag inside a pre tag, which appearently (According to w3 validator is not ok). Tidy sees this and closes the pre early, which produces ugly box (or at least does on mediawiki.org). See Code like: <source lang="php"> <?php echo "hello world"; function barf() { // ha ha } </source> produces html like this: https://www.mediawiki.org/w/index.php?title=Project:Sandbox&oldid=523798 <pre dir="ltr" class="mw-geshi mw-content-ltr"><div class="php source-php"><pre class="de1"><span class="kw2"><?php</span> <span class="kw1">echo</span> <span class="st0">"hello world"</span><span class="sy0">;</span> <span class="kw2">function</span> barf<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span> <span class="co1">// ha ha</span> <span class="br0">}</span></pre></div></pre> Which tidy turns into: <pre dir="ltr" class="mw-geshi mw-content-ltr"> </pre> <div class="php source-php"> <pre class="de1"> <span class="kw2"><?php</span> <span class="kw1">echo</span> <span class="st0">"hello world"</span><span class="sy0">;</span> <span class="kw2">function</span> barf<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span> <span class="co1">// ha ha</span> <span class="br0">}</span> </pre> Which is wrong (note the closed pre at beginning). This appears to be new with putting 1.20 on mediawiki.org
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SyntaxHighlight_GeSHi.git;a=shortlog There's nothing that is obviously committed that is a problem. So is it just presumably MW itself/Tidy at fault?
(In reply to comment #1) > https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SyntaxHighlight_GeSHi.git;a=shortlog > > There's nothing that is obviously committed that is a problem. > > So is it just presumably MW itself/Tidy at fault? Hmm, Maybe we updated the version of the GESHI code (As opposed to the extension that just bridges it) at some point and that caused the issue. I just checked, and the issue is not present at enwikipedia. Html before tidy on enwikipedia looks like: <div dir="ltr" class="mw-geshi mw-content-ltr"><div class="php source-php"><pre class="de1"><span class="kw2"><?php</span> <span class="kw1">echo</span> <span class="st0">"hello world"</span><span class="sy0">;</span> <span class="kw2">function</span> barf<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span> <span class="co1">// ha ha</span> <span class="br0">}</span></pre></div></div> No nested pre.
*** This bug has been marked as a duplicate of bug 35875 ***
I updated the version running on the WMF cluster to 1.0.8.10 back at the 2011 Berlin Hackathon... Which is also the version that comes with git now... So that shouldn't have had any chance https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/SyntaxHighlight_GeSHi.git;a=commit;h=5dfa1034c1efbb52c87340a46b85399ce4f38156 ^ that looks vaguely relevant