Last modified: 2012-04-12 13:54:21 UTC
</noinclude> gets parsed within <pre></pre> in templates, causing explanatory text to be transcluded into pages. In the following example, everything after </pre> and </noinclude> incorrectly gets transcluded wherever the template is used. The only workaround is to use <includeonly></includeonly> instead of <onlyinclude></onlyinclude>, which should not be necessary, and can cause problems if that is not how the template was designed. This problem arises from the best-practice of encapsulating templatized category tags within no-include tags so that category transclusion will happen only once, not every time some other page uses the page that has a category template. Here's the example: <noinclude> This is a category template for quickly adding pages to some categories. It is supposed to put the following into a page: <pre> <noinclude> <!-- If this page is embedded within another page, noinclude will prevent that page from unintentionally becoming part of these categories --> [[Category:Stuff]] [[Category:Some other stuff]] </noinclude> </pre> </noinclude> Here's a sentence that's not supposed to be transcluded, but will be due to this bug. <includeonly> <noinclude> <!-- If this page is embedded within another page, noinclude will prevent that page from unintentionally becoming part of these categories --> [[Category:Stuff]] [[Category:Some other stuff]] </noinclude> </includeonly>
Forgot to mention that the solution to this bug is to have the parser treat <pre> like <nowiki>, and ignore all tags found within, including the </noinclude> tags that the parser is tripping over in this example.
It looks like there may be other problems with the way pre is parsed: http://meta.wikimedia.org/wiki/Help_talk:Wikitext_examples#Pre-nowiki_inside_list_example_doesn.27t_seem_to_work
The parser doesn't handle nested tags as you would expect. When it finds an <noinclude> start tag, it just searches for the next matching </noinclude> end tag, without considering nested start tags. See bug 9428 for more examples with other tags. *** This bug has been marked as a duplicate of bug 9428 ***