mirror of
https://github.com/friendica/friendica
synced 2024-11-20 15:03:41 +00:00
Detect the namespace uri from token name
This commit is contained in:
parent
32d4a359f1
commit
f9a9b70123
1 changed files with 16 additions and 2 deletions
|
@ -3037,7 +3037,21 @@ class HTML5_TreeBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function insertElement($token, $append = true) {
|
private function insertElement($token, $append = true) {
|
||||||
$el = $this->dom->createElementNS(self::NS_HTML, $token['name']);
|
$sep_pos = strpos($token['name'],':');
|
||||||
|
$ns_uri = self::NS_HTML;
|
||||||
|
if($sep_pos !== FALSE) {
|
||||||
|
// This tag has a namespace
|
||||||
|
$ns = substr($token['name'], 0, $sep_pos);
|
||||||
|
switch($ns) {
|
||||||
|
case 'g':
|
||||||
|
$ns_uri = 'http://base.google.com/ns/1.0';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
logger("HTML5/TreeBuilder.php: Unknown namespace '". $ns ."', tag = ". $token['name'], LOGGER_DEBUG);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$el = $this->dom->createElementNS($ns_uri, $token['name']);
|
||||||
|
|
||||||
if (!empty($token['attr'])) {
|
if (!empty($token['attr'])) {
|
||||||
foreach($token['attr'] as $attr) {
|
foreach($token['attr'] as $attr) {
|
||||||
|
|
Loading…
Reference in a new issue