Fix issue with Markdown rendering after line break in strict mode #889
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identify the Bug
I noticed this text in the core settings:
But the text is correct in the config schema, so what's going on?
I'll distill it for you:
Description of the Change
I don't know enough about why this callback is in place, but I assume the reasoning is sound. Nonetheless, we're advancing a fixed number of characters in the parser when consuming it, even though the matched line break can be of variable width (
<br>
,<br />
, etc.).Alternate Designs
I did not think about this for long enough to consider alternate designs.
Possible Drawbacks
I might have misinterpreted this code, though it certainly does seem to fix the problem.
I also took the liberty of changing the token content from
<br/>
to<br>
, since the former is invalid HTML (you'd need a space before the closing slash) and we're way past the XHTML days. But as far as I can tell, this makes no difference to the parser output anyway.Verification Process
Run the example code from above in the console. It should do the wrong thing on
master
and the right thing on this PR branch. Also, the setting in question (in Core) should render correctly.Release Notes
atom.ui.markdown.render
whendisableMode
was set to"strict"
and the input contained HTML line breaks.