Skip to content

Ordered lists do not respect the start number #482

Description

@alcrene

Describe the problem

When I parse the following markdown with the current pip version of MyST-Parser

# My nifty title

5. This list
6. should start
7. with 5.

I get a list which starts with 5, but instead it starts with 1:

ol-should-start-at-5

In contrast, markdown-it-py produces the correct HTML, so this issue seems specific to MyST-Parser.

Link to your repository or website

No response

Steps to reproduce

Here's a bash script that reproduces the issue. It's tested on Linux and can be run in a throwaway folder like ~/tmp; it does the following:

  • Creates a new virtual environment
  • Installs MyST-Parser and sphinx
  • Creates a new blank sphinx project
  • Adds a file with the markdown given above
  • Calls make html
python3 -m venv env-myst-test
source env-myst-test/bin/activate
pip install --upgrade pip myst-parser sphinx
sphinx-quickstart myst-test   # Answer [n] to the first question

cd myst-test

echo """# My nifty title

5. This list
6. should start
7. with 5.
""" > myfile.md

cp conf.py conf.py.back
sed "s/extensions = \[/&\n   'myst_parser'/" conf.py.back > conf.py

cp index.rst index.rst.back
sed "s/Contents:/&\n\n   myfile.md/" index.rst.back > index.rst

make html

$BROWSER _build/html/myfile.html

The version of Python you're using

Python 3.6.12

Your operating system

OpenSUSE LEAP 15.2

Versions of your packages

MyST-Parser: 0.16.1
Sphinx     : 4.3.2

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions