Benutzer:WiMu/DPL-bug/include: Unterschied zwischen den Versionen

aus Kamelopedia, der wüsten Enzyklopädie
Zur Navigation springen Zur Suche springen
K (so, jetzt ersmal genug rumgenerded)
K (+ includeonly)
Zeile 12: Zeile 12:
 
| include = {Test}
 
| include = {Test}
 
}} (see: [[Kamel:WiMu/DPL-bug/include/pre]])
 
}} (see: [[Kamel:WiMu/DPL-bug/include/pre]])
 +
* {{#dpl:
 +
| mode    = userformat
 +
| title  = Kamel:WiMu/DPL-bug/include/includeonly
 +
| include = {Test}
 +
}} (see: [[Kamel:WiMu/DPL-bug/include/includeonly]])
 
* {{#dpl:
 
* {{#dpl:
 
| mode    = userformat
 
| mode    = userformat

Version vom 5. Juli 2010, 11:04 Uhr

Parameter | include = {template} makes some problems, when Wiki-syntax like {{template|foo}} is nested within <nowiki> or <pre>-tags on matching pages:



No problems with parameter | uses:


quick&dirty bug fix:

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- and pre-tags */
$text = preg_replace('/<!--.*?-->/s','',$parser->fetchTemplate($title));
$text = preg_replace('/<nowiki>.*?<\/nowiki>/s','',$text);
$text = preg_replace('/<pre>.*?<\/pre>/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)




Siehe auch.png Schau mal in die Wahnsinnig Weite Wüste: http://semeb.com/dpldemo/index.php?title=Issue:Include-bug_with_nowiki-_and_pre-tags