-
Notifications
You must be signed in to change notification settings - Fork 36
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
Extra newlines between HTML blocks should be preserved #16
Comments
Thanks a lot for letting me know! |
Yeah the event streams are quite hard to tell apart: $ echo '<p>\nfoo\n</p>\n<script>\na\n\nb\n</script>' | pulldown-cmark -e
0..4: Html(Borrowed("<p>\n"))
4..8: Html(Borrowed("foo\n"))
8..13: Html(Borrowed("</p>\n"))
13..22: Html(Borrowed("<script>\n"))
22..24: Html(Borrowed("a\n"))
25..37: Start(Paragraph)
25..26: Text(Borrowed("b"))
26..27: SoftBreak
27..36: Html(Borrowed("</script>"))
25..37: End(Paragraph)
EOF
$ echo '<p>\nfoo\n</p>\n\n<script>\na\n\nb\n</script>' | pulldown-cmark -e
0..4: Html(Borrowed("<p>\n"))
4..8: Html(Borrowed("foo\n"))
8..13: Html(Borrowed("</p>\n"))
14..23: Html(Borrowed("<script>\n"))
23..25: Html(Borrowed("a\n"))
25..26: Html(Borrowed("\n"))
26..28: Html(Borrowed("b\n"))
28..38: Html(Borrowed("</script>\n"))
EOF There's no difference until it actually encounters the blank line at position 25. That's potentially a lot of state to have to buffer. Maybe it's better to fix this in pulldown-cmark itself somehow? |
Yes, that would be optimal. My guess is that this one has the potential for a bigger conversation, as it really asks the question if If the answer is negative, we can only try to fix things here with more state and generally, complication, which I am to some extend OK with as long as I don't have to write it :D. If the answer is positive, I feel that the |
stupicat turns this:
into this:
But apparently without the extra newline, pulldown-cmark doesn't think the
<script>
tag is its own block:Obviously the tags in the middle of the
<script>
mangle everything.The text was updated successfully, but these errors were encountered: