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
Figure captions: HTML (and markdown) not getting rendered #535
Comments
@jackbaty I will need more details. The test page is exporting alright: Looking at the HTML source of that test page, the HTML inside the captions looks good: <p>Some text before image.</p>
<figure><img src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png"
alt="Figure 1: A unicorn! &ldquo;Something in double quotes&rdquo;"/><figcaption>
<p><span class="figure-number">Figure 1: </span>A unicorn! “Something in double quotes”</p>
</figcaption>
</figure>
<p>Some more text, after image.</p>
<figure><img src="https://ox-hugo.scripter.co/test/images/org-mode-unicorn-logo.png"
alt="Figure 2: The same figure again, testing a link too!"/><figcaption>
<p><span class="figure-number">Figure 2: </span>The <em>same</em> figure <strong>again</strong>, testing <a href="https://ox-hugo.scripter.co">a link</a> too!</p>
</figcaption>
</figure> The test site is using Hugo v0.92.0 (regular version, not extended). Do you happen to have a custom |
Replace this line: with {{ .Get "caption" | markdownify }} .. and the same for "attr": {{ .Get "attr" | markdownify }} |
Coincidentally, I was involved this fixing the default So I kind of guessed quickly what was going on with this issue 😄 . |
Oh my, I'd forgotten I was using a custom shortcode. Sorry for the noise. You're right, calling markdownify on those elements takes care of the problem. Thank you much! |
I don't know if this is the right place to mention this, but using latest ox-hugo with figure captions, HTML markup in the captions are rendered encoded, e.g.:
This is from the following Org content:
The Markdown renders as:
I'm running latest doom emacs with unpinned ox-hugo and Hugo v0.92.0+extended. Let me know if there's a better place for this or if I'm missing something. Thanks.
Originally posted by @jackbaty in #321 (comment)
The text was updated successfully, but these errors were encountered: