yfm-transform icon indicating copy to clipboard operation
yfm-transform copied to clipboard

Feature Request: Add Captions to Images

Open martyanovandrey opened this issue 5 months ago • 4 comments

Description

The current version of YFM allows users to add images with alt-text and title props. To enhance image context and readability, i propose utilizing the figcaption HTML tag for rendering captions. To enable the display of the caption you need to add the { caption } as attribute, the default value is equal to the title, but it can also be passed in the attribute

Example Syntax

![Alt text](_images/image.png "Caption text" =100x100){ caption }

In this example, the "Caption text" should be rendered within a figcaption tag below the image.

Example HTML Output

The resulting HTML should look like this:

<figure>
    <img src="_images/image.png" alt="Alt text" width="100" height="100" title="Caption text">
    <figcaption>Caption text</figcaption>
</figure>

DOCSTOOLS-3428

martyanovandrey avatar Sep 18 '24 08:09 martyanovandrey