Difference between revisions of "Issue:Html-comments in parameter names"
Line 3: | Line 3: | ||
|Extension = DPL | |Extension = DPL | ||
|Version = 1.7.4 | |Version = 1.7.4 | ||
− | |Description = parameters like <tt> | + | |Description = parameters like <tt><nowiki>{{|}}</nowiki> parametername <nowiki><!-- comment --></nowiki> =</tt> behave unlike standard Wiki-syntax |
|Status = closed | |Status = closed | ||
}} | }} |
Revision as of 21:17, 7 June 2009
Description: | parameters like <nowiki>{{|}}</nowiki> parametername <nowiki></nowiki> = behave unlike standard Wiki-syntax |
Extension / Version: | DPL / 1.7.4 |
Type / Status: | Bug / closed |
Problem
With standard Wiki-syntax it is possible to use comments ahead the equal sign. Consider a template call like:
{{Infobox Country or territory | area <!-- in km² --> = | population_estimate <!-- other comment --> = }}
The result will be the same as without the comments (so the comments are completely ignored). The DPL query does not work like this and the result of the query below will be an empty string:
{{#dpl: | mode = userformat | ... | include = {Infobox Country or territory}:area }}
The parameter names have to be exactly like the template call, including the comment and whitespaces:
{{#dpl: | mode = userformat | ... | include = {Infobox Country or territory}:area «!-- in km² --» }}
Sorry for my lack of English. I hope you understand my problem. Greetings --WiMu 10:44, 4 May 2009 (UTC)
Reply
You are right, DPL currently is not aware of comments which might be embedded within template parameter assignments. You can change this with the following patch in line 540ff of DynamicPageList2Include.php:
if (!$found) { // named parameter $exParmQuote = str_replace('/','\/',$exParm); foreach ($parms as $parm) { if (!preg_match("/^\s*$exParmQuote\s*(<!--.*-->)*\s*=/",$parm)) continue; $found=true; $output[$n] .= $dpl->formatTemplateArg(preg_replace("/^$exParmQuote\s*(<!--.*-->)*\s*=\s*/","",$parm),$dplNr,$exParmKey,$firstCall,$maxlen); break; } }
I will make this change part of the next release. 22:52, 5 May 2009 (UTC)