diff options
Diffstat (limited to 'src/HTML5/Serializer/OutputRules.php')
-rw-r--r-- | src/HTML5/Serializer/OutputRules.php | 85 |
1 files changed, 77 insertions, 8 deletions
diff --git a/src/HTML5/Serializer/OutputRules.php b/src/HTML5/Serializer/OutputRules.php index c009698..4ad74f6 100644 --- a/src/HTML5/Serializer/OutputRules.php +++ b/src/HTML5/Serializer/OutputRules.php @@ -73,17 +73,86 @@ class OutputRules implements \Masterminds\HTML5\Serializer\RulesInterface 'nodeName'=>'img', 'nodeName'=>array('img', 'a'), 'attrName'=>'alt', 'attrName'=>array('title', 'alt'), - - - 'prefixes'=>['xh'=>'http://www.w3.org/1999/xhtml'), - 'xpath' => "@checked[../../xh:input[@type='radio' or @type='checkbox']]", ), */ array( - 'nodeNamespace'=>'http://www.w3.org/1999/xhtml', - 'attrName'=>array('alt', 'title'), + 'nodeNamespace' => 'http://www.w3.org/1999/xhtml', + 'attrName' => array('href', + 'hreflang', + 'http-equiv', + 'icon', + 'id', + 'keytype', + 'kind', + 'label', + 'lang', + 'language', + 'list', + 'maxlength', + 'media', + 'method', + 'name', + 'placeholder', + 'rel', + 'rows', + 'rowspan', + 'sandbox', + 'spellcheck', + 'scope', + 'seamless', + 'shape', + 'size', + 'sizes', + 'span', + 'src', + 'srcdoc', + 'srclang', + 'srcset', + 'start', + 'step', + 'style', + 'summary', + 'tabindex', + 'target', + 'title', + 'type', + 'value', + 'width', + 'border', + 'charset', + 'cite', + 'class', + 'code', + 'codebase', + 'color', + 'cols', + 'colspan', + 'content', + 'coords', + 'data', + 'datetime', + 'default', + 'dir', + 'dirname', + 'enctype', + 'for', + 'form', + 'formaction', + 'headers', + 'height', + 'accept', + 'accept-charset', + 'accesskey', + 'action', + 'align', + 'alt', + 'bgcolor', + ), + ), + array( + 'nodeNamespace' => 'http://www.w3.org/1999/xhtml', + 'xpath' => 'starts-with(local-name(), \'data-\')', ), - ); const DOCTYPE = '<!DOCTYPE html>'; @@ -328,7 +397,7 @@ class OutputRules implements \Masterminds\HTML5\Serializer\RulesInterface $xp->registerNamespace($nsPrefix, $ns); } } - if(!$xp->query($rule['xpath'], $attr->ownerElement)->length){ + if(!$xp->evaluate($rule['xpath'], $attr)){ continue; } } |