Kamel:WiMu/DPL-bug/include
aus Kamelopedia, der wüsten Enzyklopädie
Parameter | include = {template}
makes some problems, when Wiki-syntax like {{template|foo}}
is nested within <nowiki>
or <pre>
-tags on matching pages:
- This is (not) a template-call within <nowiki>-tags (see: Kamel:WiMu/DPL-bug/include/nowiki)
- This is (not) a template-call within <pre>-tags (see: Kamel:WiMu/DPL-bug/include/pre)
- This is (not) a template-call within <includeonly>-tags (see: Kamel:WiMu/DPL-bug/include/includeonly)
- Vorlage:Test.default
<!-- html-comments -->
seem to work as intended (see Kamel:WiMu/DPL-bug/include/html-comment)
No problems with parameter | uses
:
-
Extension:DynamicPageList (DPL), version 2.01 : Warnung: Kein passender Eintrag gefunden!
quick&dirty bug fix:[bearbeiten]
Throw away <nowiki>
or <pre>
-tags the way <!-- html-comments -->
are deleted. Change line 515ff of DynamicPageListInclude.php
to:
/* get text and throw away html comments, nowiki-, pre-, and includeonly-tags */ $text = preg_replace('/<!--.*?-->/s','',$parser->fetchTemplate($title)); $text = preg_replace('/<nowiki>.*?<\/nowiki>/s','',$text); $text = preg_replace('/<pre>.*?<\/pre>/s','',$text); $text = preg_replace('/<includeonly>.*?<\/includeonly>/s','',$text);
Works fine in my local MediaWiki, but maybe there is a better way to find template-calls than via matching regular expressions --WiMu 11:50, 5. Jul. 2010 (NNZ)
Schau mal in die Wahnsinnig Weite Wüste: http://semeb.com/dpldemo/index.php?title=Issue:Include-bug_with_nowiki-_and_pre-tags