-
-
Notifications
You must be signed in to change notification settings - Fork 893
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
react-markdown crushes if <li > element has spaces before it #535
Comments
remark appears to be parsing as expected in https://astexplorer.net/#/gist/19a843b97e350aaa80733876c81c1bed/60c88087318ea19410d99d798883b24a7733c520 |
This should be resolved by #427, in the meantime this is rendered as expected by |
yes it is correct, from the CommonMark reference implementation https://spec.commonmark.org/dingus/?text=%20%20%3Cli%3Ehey%0A%20%20%0A%20%20%3C%2Fli%3E%0A <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document SYSTEM "CommonMark.dtd">
<document xmlns="http://commonmark.org/xml/1.0">
<html_block> <li>hey</html_block>
<html_block> </li></html_block>
</document> there are two HTML blocks, which matches the described spec as well https://spec.commonmark.org/0.29/#html-blocks |
Subject of the issue
Issues with
<li >
element with a space at the beginning.This is the problematic snippet:
Your environment
react-markdown
version 5 is affected. See in the live demo as well.Steps to reproduce
remark
: https://astexplorer.net/#/gist/19a843b97e350aaa80733876c81c1bed/60c88087318ea19410d99d798883b24a7733c520react-markdown
: https://codesandbox.io/s/react-markdown-debug-forked-o5rjw?file=/src/App.jsExpected behavior
What should happen?
This text:
Should be rendered like in Github:
Actual behavior
App crushes when putting this text in
react-markdown
, as can be seen from the link.Even when adding the gfm plugin, it does not parse like Github:
https://codesandbox.io/s/react-markdown-debug-forked-o5rjw?file=/src/App.js
The text was updated successfully, but these errors were encountered: