markdown-transform icon indicating copy to clipboard operation
markdown-transform copied to clipboard

Roundtripping issue for ordered lists with a non-default initial index

Open jeromesimeon opened this issue 5 years ago • 0 comments

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:

Screenshot 2020-08-30 at 6 11 58 PM

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").

jeromesimeon avatar Aug 30 '20 22:08 jeromesimeon