-
-
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 writer incorrect output of a figure with attributes #5121
Comments
The footnote issue is separate and deserves a separate issue. Since If the figure contains a footnote, it gets rendered with the figure by the HTML writer. I'm honestly not sure how to fix this. One could remove the note from the figure caption before rendering, but then where do you add it back again? |
Yes, I understand that it writes HTML into the markdown, and that's to be expected, that's not the issue. I'm trying to report a bug about how this HTML is mixing with the markdown. Maybe I haven't been clear or I'm not understanding you 😅. I think this issue deserves to be reopened, I'll try to rephrase in case I've not been straightforward when reporting. What I mean is when feeding this markdown ( # Header 1
{width=500px}
## Header 2
Header 1
========
<figure>
<img src="./my-figure.jpg" alt="My caption" width="500" /><figcaption>My caption</figcaption>
</figure>Header 2
-------- The problem is the Header 1
========
<figure>
<img src="./my-figure.jpg" alt="My caption" width="500" /><figcaption>My caption</figcaption>
</figure>
Header 2
-------- Is this clearer? Or have I not understood you? Thanks 🙂 |
Oh no! You were perfectly clear. Maybe you missed the fact that I already fixed the bug with the blank line; that's what closed the issue. |
See commit 4060df6. |
Oh, I absolutely did, sorry! Thanks for fixing the bug and for Pandoc, it's saving me plenty of time with my thesis! I'll open another bug with the footnote issue. |
We use HTML for a figure in markdown dialects that can't represent it natively. Closes jgm#5121.
When putting an image on its own paragraph in order to make it a figure and appending an attribute to it, the outputted markdown contains an HTML block with the figure, but the following block is appended in the same line, instead of being separated by newlines. (It works if the image doesn't have additional attributes)
Repro on pandoc 2.5
I tried all the markdown variants, and only happens with
markdown_mmd
andmarkdown_strict
(although the rest of markdowns just lose the figure and output a regular image). I checked the JSON format output and it seems the AST is correct, so I think it's an issue of the writer.Because of this issue, the next block will not be parsed correctly in most markdown variants.
In what I think is related, if the figure caption contains a footnote, it will be rendered just under the figure, not joined with the rest of the footnotes in the document. (Repro case). If it's not part of the same issue, tell me so and I will open a separate issue.
The text was updated successfully, but these errors were encountered: