Installations
npm install @gerhobbelt/markdown-it-implicit-figures
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=10
Node Version
12.12.0
NPM Version
6.11.3
Score
72.1
Supply Chain
91.1
Quality
75.3
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
arve0
Download Statistics
Total Downloads
3,120
Last Day
1
Last Week
4
Last Month
26
Last Year
464
GitHub Statistics
56 Stars
72 Commits
16 Forks
4 Watching
4 Branches
8 Contributors
Bundle Size
1.78 kB
Minified
759.00 B
Minified + Gzipped
Package Meta Information
Latest Version
0.10.0-6
Package Id
@gerhobbelt/markdown-it-implicit-figures@0.10.0-6
Unpacked Size
59.87 kB
Size
8.17 kB
File Count
14
NPM Version
6.11.3
Node Version
12.12.0
Total Downloads
Cumulative downloads
Total Downloads
3,120
Last day
0%
1
Compared to previous day
Last week
-55.6%
4
Compared to previous week
Last month
-58.1%
26
Compared to previous month
Last year
13.2%
464
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
markdown-it-implicit-figures
Render images occurring by itself in a paragraph as <figure><img ...></figure>
, similar to pandoc's implicit figures.
Example input:
1text with ![](img.png) 2 3![](fig.png) 4 5works with links too: 6 7[![](fig.png)](page.html)
Output:
1<p>text with <img src="img.png" alt=""></p> 2<figure><img src="fig.png" alt=""></figure> 3<p>works with links too:</p> 4<figure><a href="page.html"><img src="fig.png" alt=""></a></figure>
Install
$ npm install --save markdown-it-implicit-figures
Usage
1var md = require('markdown-it')(); 2var implicitFigures = require('markdown-it-implicit-figures'); 3 4md.use(implicitFigures, { 5 dataType: false, // <figure data-type="image">, default: false 6 figcaption: false, // <figcaption>alternative text</figcaption>, default: false 7 tabindex: false, // <figure tabindex="1+n">..., default: false 8 link: false // <a href="img.png"><img src="img.png"></a>, default: false 9}); 10 11var src = 'text with ![](img.png)\n\n![](fig.png)\n\nanother paragraph'; 12var res = md.render(src); 13 14console.log(res);
Options
-
dataType
: SetdataType
totrue
to declare the data-type being wrapped, e.g.:<figure data-type="image">
. This can be useful for applying special styling for different kind of figures. -
figcaption
: Setfigcaption
totrue
to put the alternative text in a<figcaption>
-block after the image. E.g.:![text](img.png)
renders to1<figure> 2 <img src="img.png" alt=""> 3 <figcaption>text</figcaption> 4</figure>
-
tabindex
: Settabindex
totrue
to add atabindex
property to each figure, beginning attabindex="1"
and incrementing for each figure encountered. Could be used with this css-trick, which expands figures upon mouse-over. -
link
: Put a link around the image if there is none yet. -
copyAttrs
: Copy attributes matching (RegExp or string)copyAttrs
tofigure
element.
License
MIT © Arve Seljebu
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
Reason
Found 5/22 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/arve0/markdown-it-implicit-figures/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/arve0/markdown-it-implicit-figures/test.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/test.yml:11
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 14 are checked with a SAST tool
Score
3.4
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More