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

Inconsistent list rendering #830

Closed
fabiospampinato opened this issue Dec 15, 2021 · 3 comments
Closed

Inconsistent list rendering #830

fabiospampinato opened this issue Dec 15, 2021 · 3 comments
Labels

Comments

@fabiospampinato
Copy link

The following Markdown:

1. asd
   1. asd

---

1. asd
	1. asd

---

1. asd
   2. asd

---

1. asd
	2. asd

Generates this in markdown-it, in commonmark-strict mode:

Screen Shot 2021-12-15 at 23 13 08

While commonmark.js generates this:

Screen Shot 2021-12-15 at 23 13 54

So there seems to be some slightly differences there.

@puzrin puzrin added the bug label Dec 15, 2021
@puzrin
Copy link
Member

puzrin commented Jan 7, 2022

Difference is certainly not nice. But in this case i can't say immediately, is this bug of markdown-it or of reference commonmark implementation (not sure what spec says).

If you have time, could you ask @jgm in commonmark tracker, how your last case is expected to work (according to spec)? Anyway, i think they can wish to add this case into spec. We test all spec samples and fix any deviations ASAP. Also we track pathological tests of commonmark.js.

@jgm
Copy link

jgm commented Jan 7, 2022

See section 5.3 of the spec:

In order to solve [the problem of] of unwanted lists in paragraphs with hard-wrapped numerals, we allow only lists starting with 1 to interrupt paragraphs.

This means that you can't have a sublist beginning with 2. unless you leave a blank line. (markdown-it is therefore not in compliance with this rule in the fourth case.)

@rlidwka rlidwka closed this as completed in 1cd8a51 Jan 7, 2022
@rlidwka
Copy link
Member

rlidwka commented Jan 7, 2022

Fixed, thanks for reporting (parser incorrectly calculated tab width for that particular case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants