[pmwiki-users] [PATCH] XHTML compliance for pagelist

Mikael Nilsson mini at nada.kth.se
Tue Nov 15 03:26:13 CST 2005


While checking my XHTML compliance, I noticed that empty lists from a 
pagelist directive still outputs <dl ...></dl> (empty list) which is not 
valid XHTML...

May i propose modifying pagelist.php like so:

--- pagelist.php~       2005-11-15 10:12:22.077808350 +0100
+++ pagelist.php        2005-11-15 10:20:10.164580960 +0100
@@ -243,6 +243,7 @@
    SDV($FPLByGroupIFmt,"<dd><a href='\$PageUrl'>\$Name</a></dd>\n");
    SDVA($FPLByGroupOpt, array('readf' => 0, 'order' => 'name'));
    $matches = MakePageList($pagename, 
array_merge((array)$FPLByGroupOpt, $opt));
+  if(!count($matches)) return "";
    if (@$opt['count']) array_splice($matches, $opt['count']);
    $out = array();
    foreach($matches as $pc) {

I'm not a PHP programmer (but I'm learning quickly with pmwiki...) so 
there might be better ways, but it seems to work for me. There are of 
course similar cases in the other formatting functions, this was just 
for ByGroup cases.


Plus ça change, plus c'est la même chose
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mini.vcf
Type: text/x-vcard
Size: 244 bytes
Desc: not available
Url : /pipermail/pmwiki-users/attachments/20051115/fc74f837/attachment.vcf 

More information about the pmwiki-users mailing list