We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Marked version: ^9.1.1
Describe the bug
the result of lex a markdown text, which contains blockquote, contains a \n
To Reproduce
import {marked} from "marked"; const lexer = new marked.Lexer(); const tokens = lexer.lex(` # Hello World > Preface say sth. ## 1. One 1111 ## 2. Two 2222 `) .filter(token => token.type !== 'space') .map(token => { return { type: token.type, text: token.text, }; }); console.log(tokens);
the output is:
[ { type: 'heading', text: 'Hello World' }, { type: 'blockquote', text: 'Preface\n' }, { type: 'paragraph', text: 'say sth.' }, { type: 'heading', text: '1. One' }, { type: 'paragraph', text: '1111' }, { type: 'heading', text: '2. Two' }, { type: 'paragraph', text: '2222' } ]
Expected behavior
my expected output is:
[ { type: 'heading', text: 'Hello World' }, { type: 'blockquote', text: 'Preface' }, // <- here, expect no '\n\ { type: 'paragraph', text: 'say sth.' }, { type: 'heading', text: '1. One' }, { type: 'paragraph', text: '1111' }, { type: 'heading', text: '2. Two' }, { type: 'paragraph', text: '2222' } ]
The text was updated successfully, but these errors were encountered:
I think that sounds reasonable to trim the text. If you want to create a PR I would approve it.
Sorry, something went wrong.
@UziTech I probably won’t be able to do this PR because I don’t know much about javascript
I created PR #3037 to fix this
Successfully merging a pull request may close this issue.
Marked version: ^9.1.1
Describe the bug
the result of lex a markdown text, which contains blockquote, contains a \n
To Reproduce
the output is:
Expected behavior
my expected output is:
The text was updated successfully, but these errors were encountered: