diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 56854e8..33d5b8f 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -181,7 +181,11 @@ class MarkdownConverter(object): def convert_li(self, el, text): parent = el.parent if parent is not None and parent.name == 'ol': - bullet = '%s.' % (parent.index(el) + 1) + if parent.get("start"): + start = int(parent.get("start")) + else: + start = 1 + bullet = '%s.' % (start + parent.index(el)) else: depth = -1 while el: diff --git a/tests/test_conversions.py b/tests/test_conversions.py index b8487e5..9e7be24 100644 --- a/tests/test_conversions.py +++ b/tests/test_conversions.py @@ -123,6 +123,7 @@ def test_i(): def test_ol(): assert md('
  1. a
  2. b
') == '\n1. a\n2. b\n\n' + assert md('
  1. a
  2. b
') == '\n3. a\n4. b\n\n' def test_p():