Codespan newline - #1652
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/markedjs/markedjs/lyg9hnduu |
| if (token = this.tokenizer.text(src, tokens)) { | ||
| src = src.substring(token.raw.length); | ||
| tokens.push(token); | ||
| if (token.type) { |
There was a problem hiding this comment.
DRY? Same code added in two places?
There was a problem hiding this comment.
That code is not really related so they could change independently.
There was a problem hiding this comment.
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.