Commit 20f618a7 authored by Gregor Morrill's avatar Gregor Morrill

Return html-lang attribute only when it has a value

parent 6dbce79a
......@@ -768,11 +768,17 @@ class Parser {
$html .= $node->ownerDocument->saveHTML($node);
}
return array(
$return = array(
'html' => $html,
'value' => unicodeTrim($this->innerText($e)),
'html-lang' => $this->language($e)
);
// Language
if ( $html_lang = $this->language($e) ) {
$return['html-lang'] = $html_lang;
}
return $return;
}
private function removeTags(\DOMElement &$e, $tagName) {
......@@ -1031,7 +1037,9 @@ class Parser {
}
// Language
$return['html-lang'] = $this->language($e);
if ( $html_lang = $this->language($e) ) {
$return['html-lang'] = $html_lang;
}
// Make sure things are in alphabetical order
sort($mfTypes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment