@@ -79,8 +79,9 @@ class Tag(TagDefinitions, Node): | |||||
if attr.value: | if attr.value: | ||||
for child in getter(attr.value): | for child in getter(attr.value): | ||||
yield attr.value, child | yield attr.value, child | ||||
for child in getter(self.contents): | |||||
yield self.contents, child | |||||
if self.contents: | |||||
for child in getter(self.contents): | |||||
yield self.contents, child | |||||
def __strip__(self, normalize, collapse): | def __strip__(self, normalize, collapse): | ||||
if self.type in self.TAGS_VISIBLE: | if self.type in self.TAGS_VISIBLE: | ||||
@@ -191,8 +191,8 @@ class Builder(object): | |||||
self._push() | self._push() | ||||
elif isinstance(token, tokens.TagAttrQuote): | elif isinstance(token, tokens.TagAttrQuote): | ||||
quoted = True | quoted = True | ||||
elif isinstance(token, (tokens.TagAttrStart, | |||||
tokens.TagCloseOpen)): | |||||
elif isinstance(token, (tokens.TagAttrStart, tokens.TagCloseOpen, | |||||
tokens.TagCloseSelfclose)): | |||||
self._tokens.append(token) | self._tokens.append(token) | ||||
if name is not None: | if name is not None: | ||||
return Attribute(name, self._pop(), quoted, padding) | return Attribute(name, self._pop(), quoted, padding) | ||||
@@ -26,8 +26,8 @@ import re | |||||
from . import contexts | from . import contexts | ||||
from . import tokens | from . import tokens | ||||
from ..nodes.tag import Tag | |||||
from ..compat import htmlentities | from ..compat import htmlentities | ||||
from ..nodes.tag import Tag | |||||
__all__ = ["Tokenizer"] | __all__ = ["Tokenizer"] | ||||
@@ -431,7 +431,7 @@ class Tokenizer(object): | |||||
try: | try: | ||||
return Tag.TRANSLATIONS[text] | return Tag.TRANSLATIONS[text] | ||||
except KeyError: | except KeyError: | ||||
self._fail_route() | |||||
return Tag.TAG_UNKNOWN | |||||
def _actually_close_tag_opening(self): | def _actually_close_tag_opening(self): | ||||
"""Handle cleanup at the end of a opening tag. | """Handle cleanup at the end of a opening tag. | ||||