Topic: Modifying htmLawed for partially allowing microdata
Below are the suggested code modifications for htmLawed 1.1.9.5 for partial support for microdata (http://www.google.com/support/webmasters/bin/answer.py?answer=176035). Microdata is an HTML5 specification, and it uses the 'link', 'meta', and 'time' HTML elements, and both existing (such as 'content') and new (such as 'itemscope') HTML element attributes. The code modifications here allow htmLawed to handle the 'meta' element in HTML body (but not 'link' or 'time'), and the 'itemid', 'itemprop', 'itemref', 'itemscope', and 'itemtype' attributes.
//(0) line 4 / comments. Add note to indicate htmLawed code modification.
//(1) line 20 / function htmLawed / $e array. Add 'meta' since it is an 'empty' element.
$e = array(..., 'meta'=>1, ...); // 87/deprecated+embed+ruby+meta
//(2) line 146 / function hl_bal / $cE array. Add 'meta' since it is an 'empty' element.
$cE = array(..., 'meta'=>1, ...);
//(3) line 157 / function hl_bal / $eI array. Add 'meta' since it is an inline element.
$eI = array(..., 'meta'=>1, ...);
//(4) line 426 / function hl_tag / $eE array. Add meta' to the list of 'empty' attributes.
static $eE = array(..., 'meta'=>1, ...);
//(5) line 433 / function hl_tag / $aNE array. Add 'itemscope' to the list of 'empty' attributes.
static $aNE = array(..., 'itemscope'=>1, ...);
//(6) line 432 / function hl_tag / $aN array. Add 'content' as an attribute for 'meta'.
static $aN = array(...'content'=>array('meta'=>1), ...);
//(7) line 433 / function hl_tag / $aNP array. Add 'itemtype' to the list of attributes that accept a URL as a value.
static $aNP = array(..., 'itemtype'=>1, ...);
//(8) line 435 / function hl_tag / $aNU array. Add to the list of universal attributes 'itemprop', 'itemref', 'itemscope', 'itemtype', and 'itemid'.
static $aNU = array(..., 'itemid'=>1, 'itemprop'=>1, 'itemref'=>1, 'itemscope'=>1, 'itemtype'=>1, ...);
//(9) line 687 / function hl_version. Change the returned value to indicate htmLawed code modification.