From 3938809dd5d7f0a5921aabb9b2825715d3226790 Mon Sep 17 00:00:00 2001 From: auouymous Date: Sat, 1 Jan 2022 18:15:51 -0700 Subject: [PATCH] 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. --- src/gpodder/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gpodder/util.py b/src/gpodder/util.py index e640b5ed6..7d99c59b3 100644 --- a/src/gpodder/util.py +++ b/src/gpodder/util.py @@ -776,6 +776,10 @@ def __call__(self, document): 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()))