diplodoc-platform / diplodoc-platform/transform

Feature Request: Add Captions to Images

Open
#514 4 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
TypeScript
Stars
69
Forks
59
Avg merge
1d 21h
Merged PRs (30d)
6

Description

#### 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
```markdown
![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:
```html

Alt text
Caption text

```

DOCSTOOLS-3428

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.