markdown-transform
markdown-transform copied to clipboard
Roundtripping issue for ordered lists with a non-default initial index
Describe the bug
Ordered lists with a non-default initial index (e.g., 5. this is the first item) follow different boundaries rules from ordered lists with a default initial index (e.g., 1. this is the first item) and do not properly round trip.
To Reproduce
bash-3.2$ more test.md
This is a default index ordered list
1. first item
This is a non-default index ordered list
5. first item
This is not a list
5. first item
bash-3.2$ ./packages/markdown-cli/index.js transform --from markdown --to commonmark --roundtrip --input test.md
6:13:07 PM - info:
This is a default index ordered list
1. first item
This is a non-default index ordered list
5. first item
This is not a list
5\. first item
bash-3.2$
Note that for a non-default index, the roundtrip should have two new lines:
The corresponding part of the commonmark spec: https://spec.commonmark.org/0.29/#lists (look for "In order to solve of unwanted lists in paragraphs with hard-wrapped numerals").