1.0.3 • Published 9 months ago

@anthonypena/marked-image-gallery v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

@anthonypena/marked-image-gallery

Install

npm i @anthonypena/marked-image-gallery

Examples

Add the plugin to your Marked instance

import { markedImageGallery } from '@anthonypena/marked-image-gallery';
import { Marked } from 'marked';

const marked = new Marked();

marked.use(markedImageGallery());

Transformation

From:

![Alternative text](./foo.png)
![Alternative text](./bar.png)
![Alternative text](./baz.png)

to:

<figure id="image-gallery-alternative-text" class="marked-image-gallery">
    <img src="./foo.png" alt="Alternative text"/>
    <img src="./bar.png" alt="Alternative text"/>
    <img src="./baz.png" alt="Alternative text"/>
    <figcaption>Alternative text</figcaption>
</figure>

Docs

Parameters

idPrefix (optional): an id prefix

Default: ''

marked (optional): a Marked instance

Default: new Marked instance

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

10 months ago

1.0.0

10 months ago