Skip to content

Commit d6f33a8

Browse files
committed
Use NamespaceRegistry to recognize an AirBubble token
1 parent fd355f3 commit d6f33a8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/AirBubble/Parser/Tokenizer.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use ElementaryFramework\AirBubble\Exception\UnknownTokenException;
3737
use ElementaryFramework\AirBubble\Tokens\IToken;
3838
use ElementaryFramework\AirBubble\Util\TokensRegistry;
39+
use ElementaryFramework\AirBubble\Util\NamespacesRegistry;
3940

4041
/**
4142
* Template tokenizer
@@ -99,8 +100,11 @@ private function _tokenizeElement(\DOMElement $element)
99100
$this->_tokenizeElement($e);
100101
}
101102

102-
if (strpos($e->nodeName, "b:") === 0) {
103-
$this->_tokens->add($this->_toToken($e));
103+
foreach (NamespacesRegistry::registry() as $ns => $uri) {
104+
if (strpos($e->nodeName, $ns) === 0) {
105+
$this->_tokens->add($this->_toToken($e));
106+
break;
107+
}
104108
}
105109
}
106110
}

0 commit comments

Comments
 (0)