https://bugzilla.wikimedia.org/show_bug.cgi?id=35896

       Web browser: ---
             Bug #: 35896
           Summary: Geshi outputs invalid html which further gets borked
                    by tidy causing ugly boxes.
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: SyntaxHighlight (GeSHi)
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---


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

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to