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

parsing bug in raw html from markdown to html #3989

Closed
haozhu233 opened this issue Oct 23, 2017 · 4 comments
Closed

parsing bug in raw html from markdown to html #3989

haozhu233 opened this issue Oct 23, 2017 · 4 comments
Labels

Comments

@haozhu233
Copy link

haozhu233 commented Oct 23, 2017

Say I have a markdown file mixed with some raw HTML and markdown text

test.md

<span data-toggle="tooltip" data-placement="right" data-html="true" 
title="1st line of text <br> 2nd line of text">
Hover over me
</span>
...

(I'm copying the contents from https://www.bootply.com/83099)

Those html tags <> in the title attribute create some bugs when I tried to convert this markdown file to html using
pandoc -f markdown -t html test.md
I got

<p><span data-toggle="tooltip" data-placement="right" data-html="true" 
title="1st line of text &lt;br&gt; 2nd line of text"> 2nd line of text&quot;&gt; Hover over me </span></p>

My pandoc version is 1.19.2.1. Thank you!

@mb21
Copy link
Collaborator

mb21 commented Oct 23, 2017

HTML usually is supposed to have the < encoded as &lt;, which most HTML authors consistently do. Surprisingly, however, this actually seems to be valid HTML5. I tried the following in https://validator.w3.org

<!DOCTYPE html>
<html>
<head><title>foo</title></head>
<body>
<span data-toggle="tooltip" data-placement="right" data-html="true" 
title="1st line of text <br> 2nd line of text">
Hover over me
</span>
</body>
</html>

@jgm
Copy link
Owner

jgm commented Oct 23, 2017 via email

@haozhu233
Copy link
Author

@mb21 @jgm Awesome! Thank you both so much for your quick response!

@jgm jgm closed this as completed in 896803b Oct 24, 2017
@jgm jgm reopened this Nov 1, 2017
jgm added a commit that referenced this issue Nov 1, 2017
We didn't fix it completely before.
@jgm
Copy link
Owner

jgm commented Nov 1, 2017

Turns out we didn't completely fix this before.
I've updated the test so it fails again.

@jgm jgm added the bug label Nov 1, 2017
@jgm jgm closed this as completed in ed3d466 Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants