Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordered lists do not respect the start number #482

Closed
alcrene opened this issue Dec 30, 2021 · 2 comments · Fixed by #483
Closed

Ordered lists do not respect the start number #482

alcrene opened this issue Dec 30, 2021 · 2 comments · Fixed by #483
Labels
bug Something isn't working

Comments

@alcrene
Copy link

alcrene commented Dec 30, 2021

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

@alcrene alcrene added the bug Something isn't working label Dec 30, 2021
@welcome
Copy link

welcome bot commented Dec 30, 2021

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

chrisjsewell added a commit that referenced this issue Dec 30, 2021
Propagate the starting number of ordered lists to the docutils AST.

fixes #482
@chrisjsewell
Copy link
Member

Good spot, surprised no one has noticed that before 🤷: fixed in #483 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants