Fix shownotes for episodes that contain HTML comments.

When html5lib is used, a function is returned for each comment in the
HTML. It should be safe to skip functions until something else is found
to use them that causes issues finding hyperlinks.

Fixes #1195.
This commit is contained in:
auouymous 2022-01-01 18:15:51 -07:00
parent fc98f3f95f
commit 3938809dd5
1 changed files with 4 additions and 0 deletions

View File

@ -776,6 +776,10 @@ class ExtractHyperlinkedText(object):
return self.extracter.get_result()
def visit(self, element):
# skip functions generated by html5lib for comments in the HTML
if callable(element.tag):
return
NS = '{http://www.w3.org/1999/xhtml}'
tag_name = (element.tag[len(NS):] if element.tag.startswith(NS) else element.tag).lower()
self.extracter.handle_starttag(tag_name, list(element.items()))