00170: unquoted table attributes result in invalid html

Summary: unquoted table attributes result in invalid html
Created: 2004-11-21 02:12
Status: Closed - fixed for 2.0.beta8
Category: Bug
From: jr
Assigned:
Priority: 3
Version: 2.0 dev 22
OS: all

Description: The table attributes markup produces invalid HTML unless the author puts quotes around attribute values. The following fix (an extension of the code from PmWiki 1) looks for unquoted attribute values.

 
 ## ||table attributes
Markup('^||','>^||||','/^\\|\\|(.*)$/e',
  "PZZ(\$GLOBALS['BlockMarkups']['table'][0] = PSS('<table '. QuoteAttrs('$1') . '>'))");

function QuoteAttrs($attr) {
  return preg_replace('/([a-zA-Z])\\s*=\\s*([^\'"]\\S*)/',"\$1='\$2'",$attr);
}
 

This seems to fix the problem.