Open anasram opened 10 months ago
Indeed, now that the Figure element has been added to the AST, we might explore a new Markdown syntax for figures to replace or supplement implicit_figures
. See #3177 for some ideas. This caption syntax could be part of that, perhaps.
Since the Figure element can now contain arbitrary block-level content, a Figure could contain a code block, a video, or anything else.
This would also help with #8752.
I also wonder now if there's a way to mention figures, tables, and even headings, dynamically like [@some-cite]
:
See [#foo-bar-table] and [#foo-bar-figure] in [#foo-bar] section.
instead of:
See Table 2 and Figure 3 in section 2.1.
where the foo-bar-figure looks as follows:
![Image alt](path/to/image.png "Image title")
: Image caption {#foo-bar-figure}
In HTML:
<figure id="foo-bar-figure">
<img src="path/to/image.png" title="Image title" alt="Image alt" />
<figcaption>Image caption</figcaption>
</figure>
i.e., the id
attribute should be for the <figure>
/<table>
elements, not for the <figcaption>
/<caption>
elements.
Just to add my tuppence to the discussion; I feel it is a mistake to use the alt text as a caption with implicit_figures as alt text and captions serve two entirely different purposes (at least in a HTML context). Having a way to specify a caption and alt text (for accessibility reasons) without breaking everyone else's documents that relied on the alt-text-as-caption behaviour would be very much appreciated.
Usually, after a table in a markdown file, pandoc converts a line like this:
to
<caption>
.I wonder if it's a good idea to use this syntax as a unified syntax to generate
<caption>
and<figcaption>
too, not only for images, but also forvideo
,audio
, and even<pre>
elements.The HTML result:
In this case, the meaning of the text before the URL will be changed. It will mean an
alt=""
attribute, not a<figcaption>
element.This could be a dramatic development for markdown syntax, but I think it's worth it.