Skip to content
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

Incorrect parsing un-indented HTML fragment #652

Open
wjordan opened this issue Mar 6, 2018 · 0 comments
Open

Incorrect parsing un-indented HTML fragment #652

wjordan opened this issue Mar 6, 2018 · 0 comments

Comments

@wjordan
Copy link

wjordan commented Mar 6, 2018

I came across an issue parsing an un-indented HTML fragment, where the parser seems to be incorrectly treating part of the HTML as a block of paragraph-text (wrapped in a <p> tag and quote-escaped). Here's a minimal-repro test case where the issue should be self-explanatory:

$ ruby -rredcarpet -e "puts Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(ARGF.read)" <<MD
<div>
<div>
</div>
</div>
<script>
  x = "hello";
</script>
MD
<div>
<div>
</div>

<p></div>
<script>
  x = &quot;hello&quot;;
</script></p>

Compare against:

$ ruby -rcommonmarker -e "puts CommonMarker.render_html(ARGF.read)" <<MD
<div>
<div>
</div>
</div>
<script>
  x = "hello";
</script>
MD
<div>
<div>
</div>
</div>
<script>
  x = "hello";
</script>
$ ruby -rkramdown -e "puts Kramdown::Document.new(ARGF.read).to_html" <<MD
<div>
<div>
</div>
</div>
<script>
  x = "hello";
</script>
MD
<div>
<div>
</div>
</div>
<script>
  x = "hello";
</script>
$ ruby -rbluecloth -e "puts BlueCloth.new(ARGF.read).text" <<MD
<div>
<div>
</div>
</div>
<script>
  x = "hello";
</script>
MD
<div>
<div>
</div>
</div>
<script>
  x = "hello";
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant