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

Pandoc clobbers span closing ">" when containing html #831

Closed
cboettig opened this issue Apr 18, 2013 · 3 comments
Closed

Pandoc clobbers span closing ">" when containing html #831

cboettig opened this issue Apr 18, 2013 · 3 comments

Comments

@cboettig
Copy link

When encountering a span element in markdown such as:

<span class="some-class" title="some _title_">_usually_</span>

Pandoc correctly parses this without clobbering the internal data, giving the html:

<p><span class="some-class" title="some _title_"><em>span text</em></span></p>

If the span element contains html closing tags inside its element, the closing span tag is clobbered by parser:

this markdown:

<span class="some-class" data-html="true" title="some <em>title</em>">But _not_ if those elements contain HTML. </span>

becomes this html

<p><span class="some-class" data-html="true" title="some <em>title</em>&quot;&gt;But <em>not</em> if those elements contain HTML. </span></p>

Note that the close of span element has been parsed into &quot;&gt;

The use of html inside a span element may be unusual, but I do not think it is incorrect. I use this with twitter-bootstrap tooltips, where it is explicitly supported by the data-html="true" option. (A utility embeds the tooltips, which I use for citations, into what is otherwise blog entry written in markdown).

Thanks for considering this arcane use case.

@jgm
Copy link
Owner

jgm commented Apr 18, 2013

This is invalid HTML. The < character MUST be escaped inside attributes.

http://www.w3.org/TR/html-markup/syntax.html#syntax-attribute-value

Garbage in, garbage out.

@jgm
Copy link
Owner

jgm commented Apr 18, 2013

Note: This means that < should be escaped even inside a data-html attribute. The twitter gizmo that is consuming this should, if properly designed, automatically unescape it.

@cboettig
Copy link
Author

Thanks for clarifying this use, and my apologies for the mistake!


Carl Boettiger
http://carlboettiger.info

sent from mobile device; my apologies for any terseness or typos
On Apr 18, 2013 9:35 AM, "John MacFarlane" notifications@github.com wrote:

Note: This means that < should be escaped even inside a data-htmlattribute. The twitter gizmo that is consuming this should, if properly
designed, automatically unescape it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/831#issuecomment-16587699
.

@jgm jgm closed this as completed Apr 18, 2013
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

2 participants