-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Inserted <p> into <li> on different unordered lists #1461
Comments
Adding an extra new line will make it render correctly but this is a bug. |
I think so, too. 👍 |
I played around with the parser and saw a suspicious looking line. The patch below seems to fix this issue: 22c22
< list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{1,}(?! )(?!\1bull )\n*|\s*$)/,
---
> list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, ...but I don't know that it doesn't cause other problems which are potentially much worse. If anyone can point me towards any tests I should run I can turn this into a PR pretty quickly. |
Running Alternatively, if you submit a PR the tests will automatically run on travis-ci |
As my PR says, the fix causes all sorts of failures. If the PR isn't acceptable hopefully it at least serves as a good starting point for an investigation into the problem. |
I don't think that is the right fix. It seems like the right fix should change the regex to distinguish between |
@UziTech: as per your comment on my PR:
This seems to be intended behaviour, which I guess invalidates your above comment:
If that's the case, I suppose this issue should be marked as wontfix and closed? |
The original issue uses two different list item styles ( |
🎉 This issue has been resolved in version 1.2.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi, I'm using version "4.0.15" along with NodeJS. The bug is still present (or is back).
|
@yannicklescure Can you give us an example input and output showing yhe problem? We can add it to our test suite and reopen this issue. |
@calculuschild I did further test trying to narrow the issue. Here is what I have tried.
The serie a, b, c gives the expected result i.e.: |
That is called a loose list and that is intended behavior that follows the CommonMark spec. |
@UziTech Thank you, I learn something new. |
Describe the bug
When putting different two unordered lists (
-
and*
) with blank lines, a<p>
tag is inserted into<li>
tag.E.g.
To Reproduce
On terminal:
npm install --save marked@0.6.2
Expected behavior
Like CommonMark, I think marked should output the following HTML:
The text was updated successfully, but these errors were encountered: