-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[markdown reader] indentation in HTML blocks is parsed as code block when markdown_in_html_blocks is enabled #1841
Comments
Indeed, this seems to be a regression. (I just tried with pandoc 1.9.4.1 and got the right result.) I'm not sure which release broke this, but I suspect the culprit is this change in version 1.13:
Previously we parsed clumps of raw HTML tags as one block. With this change, each tag went into its own block. But that had the side effect that the indented tag gets parsed as an indented code block. |
Actually, it's a bit unclear what the behavior should be. If we're really parsing markdown inside HTML tags, then anything indented four spaces should be a code block, which is exactly what we see in 1.13.2. |
This has turned out as a bug in my htmlTable R package. I have a fix for the issue consisting of removing the tabs but this removes the readability if I want to look at the raw output. If possible a solution using a comment tag may be an option:
|
Perhaps an extension to turn off automatic code blocks for indented lines would be a good workaround? |
This appears to happen not just for indented HTML, but within any HTML element. For example, unindenting the simple example above is a fix, but:
or
(I encountered this when embedding raw HTML tables, generated by the R xtable package, that had "too many" leading spaces before some of the numbers, and one HTML table row per line.) Being able to embed line-oriented markdown within HTML elements is a nice feature, but wouldn't it make sense to insist that it be at the start of an actual line, given that HTML (roughly) doesn't care? E.g.,
|
We have to: - Re-enable the extension that parses markdown inside raw html. - Flatten the tables, so they are processed as html instead of code (see jgm/pandoc#1841).
This is an example from the documentation:
The documentation says that I should get
The text was updated successfully, but these errors were encountered: