handle ol start value is not number (#127)

Co-authored-by: Mico <mico_wu@trendmicro.com>
This commit is contained in:
microdnd
2024-06-23 20:28:53 +08:00
committed by GitHub
parent 50b4640db2
commit 51390d7389

View File

@@ -326,7 +326,7 @@ class MarkdownConverter(object):
def convert_li(self, el, text, convert_as_inline):
parent = el.parent
if parent is not None and parent.name == 'ol':
if parent.get("start"):
if parent.get("start") and str(parent.get("start")).isnumeric():
start = int(parent.get("start"))
else:
start = 1