Added unordered lists

This commit is contained in:
Casey 2023-01-13 10:36:58 +03:00
parent f8e1ea1661
commit f3ddb4a1d9
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 22 additions and 0 deletions

View File

@ -75,6 +75,17 @@ def node_to_html(el: PageElement) -> str:
), ),
), ),
"br": lambda _: "\n", "br": lambda _: "\n",
"ul": lambda tag: (
"<code>%s</code>"
% str.join(
"\n",
(
" \u2022 "
+ node_to_html(li).replace("\n", "\n ").strip()
for li in tag.children
),
)
),
} }
TAG_SUBSTITUTIONS: Dict[str, str] = { TAG_SUBSTITUTIONS: Dict[str, str] = {
@ -135,6 +146,17 @@ def node_to_markdown(el: PageElement) -> str:
) )
), ),
"br": lambda _: "\n", "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] = { TAG_SUBSTITUTIONS: Dict[str, str] = {