@stunned3961/markdown-it-wikilinks-preprocessor
v1.0.5
Published
WikiMedia-style links for the markdown-it parser
Downloads
267
Maintainers
Readme
Markdown-It Wikilinks
Renders Wikimedia-style links in markdown-it. This is useful for making Markdown-based wikis.
Usage
Install this into your project:
npm --save install @stunned3961/markdown-it-wikilinks-preprocessor
...and use it:
const markdownItLinkPreprocessor = require('@stunned3961/markdown-it-wikilinks-preprocessor');
const MarkdownIt = require('markdown-it');
const md = new MarkdownIt();
md.use(markdownItLinkPreprocessor);
const result = md.render('Click [[Wiki Links|here]] to learn about [[/Wiki]] links.')
console.log(result);
Output:
<p>Click <a href="./Wiki_Links.html">here</a> to learn about <a href="/Wiki.html">Wiki</a> links.</p>
TODO
- Unit test options
- Add examples to
postProcessPageName
andpostProcessLabel
Credits
Based on markdown-it-wikilinks by Julio Sepia, @kwvanderlinde/markdown-it-wikilinks by Kenneth VanderLinde and markdown-it-wikilinks by Oliver Marks.
Based on markdown-it-ins by Vitaly Puzrin, Alex Kocharin.