Skip to content
Discussion options

You must be logged in to vote

Pandoc does this because its internal document model has no bare-anchor node. When it reads <a id="w"></a>, the only thing it can represent is an inline with an id and no other content, which is a Span: Span ("w",[],[]) []. On the way out, an inline has to live inside a block, so it gets wrapped in a paragraph, which is why you get <p><span id="w"></span></p>.

There is no markdown or AST construct that maps back to a lone <a id="...">, so keeping it verbatim as raw HTML is exactly the right move, not just a fallback. As long as the raw_html extension is on (it is by default for the html reader and the markdown writer), pandoc stores the tag as a RawInline "html" and passes it through unch…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jidanni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants