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

Lexer: Space after list appears in last list_item #1947

Closed
ApayRus opened this issue Feb 15, 2021 · 1 comment · Fixed by #1936
Closed

Lexer: Space after list appears in last list_item #1947

ApayRus opened this issue Feb 15, 2021 · 1 comment · Fixed by #1936
Labels
category: lists L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue released

Comments

@ApayRus
Copy link

ApayRus commented Feb 15, 2021

marked 2.0.0

Sorry if it is not a bug, but a feature...

In a semantic tree (marked.lexer) an empty space between List and Paragraph appears in a last list_item. It looks unlogical.

While traverse the tree, you should write additional code for exclude this empty space from list_item. And then write code to add space between List and Paragraph.

Expected: Space node should be at the first level of the semantic tree, between the List and the next Paragraph

for reproduce, please visit:
https://codesandbox.io/s/markedjs-klt1h?file=/src/marked8lexer.js

import marked from "marked";

const markdownText = `This is paragraph 

this is a list with 3 items: 

- item one 
- item two 
- item tree 

Here is another paragrah.`;

const lexerArray = marked.lexer(markdownText);

console.log(lexerArray);

Screenshot from 2021-02-15 19-40-18

@ApayRus ApayRus changed the title Space after list appears in last list_item Lexer: Space after list appears in last list_item Feb 15, 2021
@UziTech UziTech added category: lists L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue labels Feb 15, 2021
@github-actions
Copy link

🎉 This issue has been resolved in version 2.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: lists L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants