Last modified: 2012-04-11 22:49:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37896, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35896 - Geshi outputs invalid html which further gets borked by tidy causing ugly boxes.
Geshi outputs invalid html which further gets borked by tidy causing ugly boxes.
Status: RESOLVED DUPLICATE of bug 35875
Product: MediaWiki extensions
Classification: Unclassified
SyntaxHighlight (GeSHi) (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: MW 1.20 version
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-11 20:52 UTC by Bawolff (Brian Wolff)
Modified: 2012-04-11 22:49 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bawolff (Brian Wolff) 2012-04-11 20:52:17 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">&lt;?php</span>
<span class="kw1">echo</span> <span class="st0">&quot;hello world&quot;</span><span class="sy0">;</span>
<span class="kw2">function</span> barf<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
  <span class="co1">// ha ha</span>

<span class="br0">&#125;</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">&lt;?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
Comment 1 Sam Reed (reedy) 2012-04-11 22:31:54 UTC
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?
Comment 2 Bawolff (Brian Wolff) 2012-04-11 22:43:05 UTC
(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">&lt;?php</span>
<span class="kw1">echo</span> <span class="st0">&quot;hello world&quot;</span><span class="sy0">;</span>
<span class="kw2">function</span> barf<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
  <span class="co1">// ha ha</span>

<span class="br0">&#125;</span></pre></div></div>


No nested pre.
Comment 3 Krinkle 2012-04-11 22:44:37 UTC

*** This bug has been marked as a duplicate of bug 35875 ***
Comment 4 Sam Reed (reedy) 2012-04-11 22:49:09 UTC
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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links