From 7955120a7c8e66c7ea7b1a69df60c6666386c089 Mon Sep 17 00:00:00 2001 From: hkc Date: Mon, 8 May 2023 18:28:43 +0300 Subject: [PATCH] Added _mfm_blur_ class check --- mastoposter/utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mastoposter/utils.py b/mastoposter/utils.py index 955c0ee..7935785 100644 --- a/mastoposter/utils.py +++ b/mastoposter/utils.py @@ -86,6 +86,14 @@ def node_to_html(el: PageElement) -> str: "code": lambda tag: ( "%s" % str.join("", map(node_to_html, tag.children)) ), + "span": lambda tag: ( + ( + '%s' + if "_mfm_blur_" in tag["class"] + else "%s" + ) + % str.join("", map(node_to_html, tag.children)) + ), "blockquote": lambda tag: "\n%s" % str.join( "\n", @@ -177,6 +185,10 @@ def node_to_markdown(el: PageElement) -> str: "code": lambda tag: ( "`%s`" % str.join("", map(node_to_markdown, tag.children)) ), + "span": lambda tag: ( + ("||%s||" if "_mfm_blur_" in tag["class"] else "%s") + % str.join("", map(node_to_markdown, tag.children)) + ), "blockquote": lambda tag: ( "\n%s" % str.join(