Last modified: 2014-10-08 10:10:44 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><code> and completely re-written inside of <pre> tags, as is done on MW.)
Robert, usage of http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi would be more appropiate there than <code><pre>
I think that misses the point, as without any extensions or cleaners, there's still a bug in the output of the PHP script.
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
MW 1.18.x is not supported anymore. Please upgrade and report back.
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>.
Will this bug ever be addressed? It's been four years and relies on every html renderer to work around the bad output.
Sorry for the gripe (using 1.23.3). Just figured this affects most everyone.
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.