Last modified: 2014-10-08 10:10:44 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 T28047, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26047 - Mismatched tags in rendered HTML
Mismatched tags in rendered HTML
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.22.2
All All
: Low minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://sourceforge.net/apps/mediawiki...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-22 03:37 UTC by Robert Morley
Modified: 2014-10-08 10:10 UTC (History)
5 users (show)

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


Attachments

Description Robert Morley 2010-11-22 03:37:16 UTC
If you look at the HTML source for the URL above, you will see that the <code> tag in the wiki source is incorrectly rendered as:

<p><code> 
</p>

This leaves the <code> tag unclosed (though it's later closed in a similar mismatched block). While various tidiers will clean this in different ways, those wikis that don't have tidying enabled, as above, will emit pages with invalid HTML. Even for those that do, the handling of the tags changes from one implementation to the next. (In testing the bug on different wikis, I found unfixed, rendered as <p>&lt;code> and completely re-written inside of <pre> tags, as is done on MW.)
Comment 1 Platonides 2011-02-08 21:26:46 UTC
Robert, usage of http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi would be more appropiate there than <code><pre>
Comment 2 Robert Morley 2011-02-08 21:32:34 UTC
I think that misses the point, as without any extensions or cleaners, there's still a bug in the output of the PHP script.
Comment 3 Rob Bairos 2013-07-24 20:32:58 UTC
Ive just come across this bug as well.
We are trying to create a html render of our documentation, which involves parsing the html output and trimming out irrelevant sections. 
However as the tags don't match, our parser breaks down.
We are using MediaWiki 1.18.0
Comment 4 Andre Klapper 2013-07-25 06:27:31 UTC
MW 1.18.x is not supported anymore. Please upgrade and report back.
Comment 5 Robert Morley 2014-02-15 07:02:12 UTC
Still occurs in 1.22.x. Simple case is as follows:
<code>
 Test
</code>

It's the space in front of test that creates the anomaly. Removing the space, which of course gives you plain text instead of pre-style text, wraps the entire code block in a <p> as you would expect, rather than wrapping each of the start and end code tags in a <p>.
Comment 6 Rob Bairos 2014-10-07 20:45:33 UTC
Will this bug ever be addressed? It's been four years and relies on every html renderer to work around the bad output.
Comment 7 Rob Bairos 2014-10-07 20:52:51 UTC
Sorry for the gripe (using 1.23.3). Just figured this affects most everyone.
Comment 8 Andre Klapper 2014-10-08 10:10:44 UTC
The bug report is low priority - a patch would speed up fixing it. See https://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker for more info.

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


Navigation
Links