forked from hkc/mastoposter
Added ordered list
This commit is contained in:
parent
f3ddb4a1d9
commit
3fc8a3bcd8
|
@ -86,6 +86,17 @@ def node_to_html(el: PageElement) -> str:
|
|||
),
|
||||
)
|
||||
),
|
||||
"ol": lambda tag: (
|
||||
"<code>%s</code>"
|
||||
% str.join(
|
||||
"\n",
|
||||
(
|
||||
"%d. %s"
|
||||
% (i, node_to_html(li).replace("\n", "\n ").strip())
|
||||
for i, li in enumerate(tag.children, 1)
|
||||
),
|
||||
)
|
||||
),
|
||||
}
|
||||
|
||||
TAG_SUBSTITUTIONS: Dict[str, str] = {
|
||||
|
@ -157,6 +168,17 @@ def node_to_markdown(el: PageElement) -> str:
|
|||
),
|
||||
)
|
||||
),
|
||||
"ol": lambda tag: (
|
||||
"\n``%s``\n"
|
||||
% str.join(
|
||||
"\n",
|
||||
(
|
||||
"%d. %s"
|
||||
% (i, node_to_markdown(li).replace("\n", "\n ").strip())
|
||||
for i, li in enumerate(tag.children, 1)
|
||||
),
|
||||
)
|
||||
),
|
||||
}
|
||||
|
||||
TAG_SUBSTITUTIONS: Dict[str, str] = {
|
||||
|
|
Loading…
Reference in New Issue