{"id":19964386,"url":"https://github.com/arve0/markdown-it-implicit-figures","last_synced_at":"2025-07-15T16:31:48.396Z","repository":{"id":2522960,"uuid":"46749122","full_name":"arve0/markdown-it-implicit-figures","owner":"arve0","description":"Render images occurring by itself in a paragraph as `\u003cfigure\u003e\u003c img ...\u003e\u003c/figure\u003e`, similar to pandoc's implicit_figures","archived":false,"fork":false,"pushed_at":"2024-06-16T11:12:28.000Z","size":80,"stargazers_count":56,"open_issues_count":7,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-28T04:35:47.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arve0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-23T21:28:38.000Z","updated_at":"2023-12-13T05:39:48.000Z","dependencies_parsed_at":"2024-09-18T16:36:16.905Z","dependency_job_id":"f787d056-d6c7-44de-b82f-7aed03d03a28","html_url":"https://github.com/arve0/markdown-it-implicit-figures","commit_stats":{"total_commits":54,"total_committers":11,"mean_commits":4.909090909090909,"dds":0.2407407407407407,"last_synced_commit":"41c82cb36fed0d62cc0e9e09a9157b71564cb24a"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/arve0/markdown-it-implicit-figures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arve0%2Fmarkdown-it-implicit-figures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arve0%2Fmarkdown-it-implicit-figures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arve0%2Fmarkdown-it-implicit-figures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arve0%2Fmarkdown-it-implicit-figures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arve0","download_url":"https://codeload.github.com/arve0/markdown-it-implicit-figures/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arve0%2Fmarkdown-it-implicit-figures/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264396588,"owners_count":23601539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T02:23:19.252Z","updated_at":"2025-07-15T16:31:48.370Z","avatar_url":"https://github.com/arve0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markdown-it-implicit-figures [![Build Status](https://github.com/arve0/markdown-it-implicit-figures/actions/workflows/test.yml/badge.svg)](https://github.com/arve0/markdown-it-implicit-figures/actions/workflows/test.yml) [![npm version](https://badge.fury.io/js/markdown-it-implicit-figures.svg)](http://badge.fury.io/js/markdown-it-implicit-figures)\n\nRender images occurring by itself in a paragraph as `\u003cfigure\u003e\u003cimg ...\u003e\u003c/figure\u003e`, similar to [pandoc's implicit figures](http://pandoc.org/README.html#images).\n\nExample input:\n```md\ntext with ![](img.png)\n\n![](fig.png)\n\nworks with links too:\n\n[![](fig.png)](page.html)\n```\n\nOutput:\n```html\n\u003cp\u003etext with \u003cimg src=\"img.png\" alt=\"\"\u003e\u003c/p\u003e\n\u003cfigure\u003e\u003cimg src=\"fig.png\" alt=\"\"\u003e\u003c/figure\u003e\n\u003cp\u003eworks with links too:\u003c/p\u003e\n\u003cfigure\u003e\u003ca href=\"page.html\"\u003e\u003cimg src=\"fig.png\" alt=\"\"\u003e\u003c/a\u003e\u003c/figure\u003e\n```\n\n\n## Install\n\n```\n$ npm install --save markdown-it-implicit-figures\n```\n\n\n## Usage\n\n```js\nconst md = require('markdown-it')();\nconst implicitFigures = require('markdown-it-implicit-figures');\n\nmd.use(implicitFigures, {\n  dataType: false,  // \u003cfigure data-type=\"image\"\u003e, default: false\n  figcaption: false,  // \u003cfigcaption\u003ealternative text\u003c/figcaption\u003e, default: false\n  keepAlt: false // \u003cimg alt=\"alt text\" .../\u003e\u003cfigcaption\u003ealt text\u003c/figcaption\u003e, default: false\n  lazyLoading: false, // \u003cimg loading=\"lazy\" ...\u003e, default: false\n  link: false // \u003ca href=\"img.png\"\u003e\u003cimg src=\"img.png\"\u003e\u003c/a\u003e, default: false\n  tabindex: false, // \u003cfigure tabindex=\"1+n\"\u003e..., default: false\n});\n\nconst src = 'text with ![](img.png)\\n\\n![](fig.png)\\n\\nanother paragraph';\nconst res = md.render(src);\n\nconsole.log(res);\n```\n\n[demo in RunKit](https://runkit.com/embed/k48mqe5q6p56)\n\n### Options\n\n- `dataType`: Set `dataType` to `true` to declare the data-type being wrapped,\n  e.g.: `\u003cfigure data-type=\"image\"\u003e`. This can be useful for applying special\n  styling for different kind of figures.\n- `figcaption`: Set `figcaption` to `true` or `alt` to put the alternative text\n  in a `\u003cfigcaption\u003e`-block after the image. E.g.: `![text](img.png)` renders to\n\n  ```html\n  \u003cfigure\u003e\n    \u003cimg src=\"img.png\" alt=\"\"\u003e\n    \u003cfigcaption\u003etext\u003c/figcaption\u003e\n  \u003c/figure\u003e\n  ```\n  - Set `figcaption` to `title` to put the title text in a `\u003cfigcaption\u003e`-block\n    after the image. E.g.: `![text](img.png \"title\")` renders to\n    ```html\n    \u003cfigure\u003e\n      \u003cimg src=\"img.png\" alt=\"text\"\u003e\n      \u003cfigcaption\u003etitle\u003c/figcaption\u003e\n    \u003c/figure\u003e\n    ```\n- `keepAlt`: Set `keepAlt` to `true` to prevent it from being cleared when turned\n  into a `figcaption`, E.g.: `![text](img.png)` renders to\n\n  ```html\n  \u003cfigure\u003e\n    \u003cimg src=\"img.png\" alt=\"text\"\u003e\n    \u003cfigcaption\u003etext\u003c/figcaption\u003e\n  \u003c/figure\u003e\n  ```\n- `tabindex`: Set `tabindex` to `true` to add a `tabindex` property to each\n  figure, beginning at `tabindex=\"1\"` and incrementing for each figure\n  encountered. Could be used with [this css-trick](https://css-tricks.com/expanding-images-html5/),\n  which expands figures upon mouse-over.\n- `lazyLoading`: Set `lazyLoading` to `true` to add `loading=\"lazy\"` to image element.\n- `link`: Put a link around the image if there is none yet.\n- `copyAttrs`: Copy attributes matching (RegExp or string) `copyAttrs` to `figure` element.\n\n\n## License\n\nMIT © [Arve Seljebu](http://arve0.github.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farve0%2Fmarkdown-it-implicit-figures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farve0%2Fmarkdown-it-implicit-figures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farve0%2Fmarkdown-it-implicit-figures/lists"}