-
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
Codespan newline #1652
Codespan newline #1652
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/markedjs/markedjs/lyg9hnduu |
src = src.substring(token.raw.length); | ||
tokens.push(token); | ||
if (token.type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DRY? Same code added in two places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That code is not really related so they could change independently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should combine that code into a function since it could change and need to be moved back anyway. This is one reason the best practice for DRY is to only combine code that needs to change together and only if it is in three or more places.
It states that two instances of similar code don't require refactoring, but when similar code is used three times, it should be extracted into a new procedure.
Marked version: v1.0.0
Description
Code spans with a newline should turn the newline into a space according to the commonmark spec.
Code spans only remove one space from each end if the text begins and ends with white-space
fixes any list items with more than one line of text.
Fixes v1.0.0 does not respect multiline code spans in list items #1651
Fixes v1.0.0 newlines inside lists #1655
Contributor
Committer
In most cases, this should be a different person than the contributor.