going-flying.com gemini git repository
0cd2381f0c2ff6ba8290aece37c198d58d500711 - Matthew Ernisse - 1615046483
thinko in nested tag handling
diff --git a/files/thoughts-to-gemini.py b/files/thoughts-to-gemini.py index 38745b5..0af2bdf 100755 --- a/files/thoughts-to-gemini.py +++ b/files/thoughts-to-gemini.py @@ -151,18 +151,18 @@ class DeHTMLizer(object): return f'```\n{tag.string}\n```' elif tag.name in nestable: + buf = '' if hasattr(tag, 'contents'): - buf = '' for el in tag.contents: buf += self.parseElement(el) - - return buf else: - if tag.name == 'blockquote': - return f'> {tag.string}' + buf = tag.string + + if tag.name == 'blockquote': + return f'> {buf}' - return tag.string + return tag.string elif tag.name in ['em', 'strong']: return f'*{tag.string}*'