diff --git a/mastoposter/utils.py b/mastoposter/utils.py index 3474908..d8de714 100644 --- a/mastoposter/utils.py +++ b/mastoposter/utils.py @@ -75,6 +75,17 @@ def node_to_html(el: PageElement) -> str: ), ), "br": lambda _: "\n", + "ul": lambda tag: ( + "%s" + % str.join( + "\n", + ( + " \u2022 " + + node_to_html(li).replace("\n", "\n ").strip() + for li in tag.children + ), + ) + ), } TAG_SUBSTITUTIONS: Dict[str, str] = { @@ -135,6 +146,17 @@ def node_to_markdown(el: PageElement) -> str: ) ), "br": lambda _: "\n", + "ul": lambda tag: ( + "\n``%s``\n" + % str.join( + "\n", + ( + " \u2022 " + + node_to_markdown(li).replace("\n", "\n ").strip() + for li in tag.children + ), + ) + ), } TAG_SUBSTITUTIONS: Dict[str, str] = {