From 0f3cac3cbf093af535abbe8353080da9dbf95e4c Mon Sep 17 00:00:00 2001 From: hkc Date: Tue, 9 May 2023 18:42:47 +0300 Subject: [PATCH] Fixed a little issue with classes not being here --- mastoposter/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mastoposter/utils.py b/mastoposter/utils.py index 7935785..f46d789 100644 --- a/mastoposter/utils.py +++ b/mastoposter/utils.py @@ -89,7 +89,7 @@ def node_to_html(el: PageElement) -> str: "span": lambda tag: ( ( '%s' - if "_mfm_blur_" in tag["class"] + if "_mfm_blur_" in tag.attrs.get("class", "") else "%s" ) % str.join("", map(node_to_html, tag.children)) @@ -186,7 +186,7 @@ def node_to_markdown(el: PageElement) -> str: "`%s`" % str.join("", map(node_to_markdown, tag.children)) ), "span": lambda tag: ( - ("||%s||" if "_mfm_blur_" in tag["class"] else "%s") + ("||%s||" if "_mfm_blur_" in tag.attrs.get("class", "") else "%s") % str.join("", map(node_to_markdown, tag.children)) ), "blockquote": lambda tag: (