-
Notifications
You must be signed in to change notification settings - Fork 335
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
No figure caption with hugo-md #11478
Comments
It would be possible to delegate this to a Hugo-hook (https://sebastiandedeyne.com/captioned-images-with-markdown-render-hooks-in-hugo/), but why bother because html does a nice job. |
I think this is something we may not be handling well for cross reference figure. This is the markdown produced by knitr as intermediate for Quarto + Pandoc ![This should be a numbered caption](test.markdown_strict_files/figure-markdown_strict/hugo-1.png){#fig-hugo width=768} If ![This should be a numbered caption](test.markdown_strict_files/figure-markdown_strict/hugo-1.png){width=768} leads to <figure>
<img src="test.markdown_strict_files/figure-markdown_strict/hugo-1.png" width="768" alt="This should be a numbered caption" />
<figcaption aria-hidden="true">This should be a numbered caption</figcaption>
</figure> So our processing is making the caption undealt with. Here is another reprex of what I think the problem is with cross ref figure for hugo-md ---
title: Hugo Captions
format: hugo-md
keep-md: true
---
::: {#fig-hugo}
![]({{< placeholder >}})
Caption
::: This leads to only fig-alt. <img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAADNklEQVR4nO2WLVYrQRBGKwuADcAGYAGAwuFQ4MAEBwYcDgUKBwoHBhwoXFxUsoG4uGQBSRaQ13dyKpDAE5jJJ757zuT09E81p25XD41+vz8NI4OFiGEhYliIGBYihoWIYSFiWIgYFiKGhYhhIWJYiBgWIoaFiGEhYliIGBYihoWIYSFiWIgYFiKGhYhhIWJYiBgWIoaFiGEhYliIGBYihoWIYSFiWIgYFiKGhYhhIWJYiBgWIoaFiGEhYliIGBYihoWIsVIhvV4vtre3S+uLwWBQfiM2NzfL7xfdbjd2d3dL6+8Qc319vXoS+uC3fba2thbm1slKhJCMi4uLSkjZv/TMuL29jeFwWFoRBwcHcXx8XM29vr6uZJCsp6enPyXr9PQ0Op1OvL6+xt7eXumJeH9/j1arVVoRGxsbcXNzE+PxOM7Pz+f73N/f/5BVBysRkpycnMTb21tpRZUQ3j8/P8tbxP7+frTb7Xh4eKgSgxwSybyzs7MyY7bm4+Mjms1mwMvLSxwdHf0QRtzLy8u5kIwNh4eH1d+AIOIRmzYPUupGRginmCRwWoExEkJ1ZDKZ8/j4OF8DVBVja2trlRzWLEOsjEFV3t3dzWMQH4nsTVUyB1iTc+pESghXxdXVVXmbjZFEBOQ1tZxM4FQzl/GctwzjxCLZ7EPMjEEFck3Rl3OAyslqrRMpId9POGO0OcGZKOaQuFyTcPdPJpPqO/EbxMoY+U3KGKxtliuPw4AY5iCZ/pxTJzJCSALvnEranFDu+efn5+qdyuE05/ckyXEeksm1swxxUwgQm32ppmxzZVGBXJm0kU+7blYihI8z1UAC+LeXO5wkZz+nmATSR6I5rY1GI6bT6cK1xBjJ/i6Rdo5nPPZB5M7OTpVk+qk0+nJvoHKotNFotLBPnaxEiPk/FiKGhYhhIWJYiBgWIoaFiGEhYliIGBYihoWIYSFiWIgYFiKGhYhhIWJYiBgWIoaFiGEhYliIGBYihoWIYSFiWIgYFiKGhYhhIWJYiBgWIoaFiGEhYliIGBYihoWIYSFiWIgYFiKGhYhhIWJYiBgWIoaFiGEhYliIGBYihoWIYSFiWIgYFiLGPxfY2Bvll5LhAAAAAElFTkSuQmCC"
id="fig-hugo" alt="Figure 1: Caption" /> It is using I believe this ends up like this because we do process Hugo markdown floatRefTarget specifically as Img quarto-cli/src/resources/filters/layout/hugo.lua Lines 80 to 96 in 178c75e
and not Figure with Here is waht Pandoc does
This is recent parsing change in Pandoc 3 I believe
So we could probably adapt Quarto output for Hugo, as floatreftarget should probably output as a figure with caption. |
Bug description
Format hugo-md does not create captions, only alt-text
Steps to reproduce
Expected behavior
Hugo needs figure captions
Actual behavior
No figure captions
Your environment
No response
Quarto check output
Quarto 1.6.36
The text was updated successfully, but these errors were encountered: