Markdown-It Wiki Custom Links
Renders Wiki-like links in markdown-it. This is useful for making Markdown-based wikis.
Usage
Install this into your project:
npm --save install markdown-it-wikicustom
...and use it:
const wikilinks = optionsconst md =
Output:
Click here to learn about Wiki links.
Options
baseURL
Default: ``
The base URL for absolute wiki links.
const html = // <p><a href="/wiki/Main-Page.html">Main Page</a></p>
relativeBaseURL
Default: ``
The base URL for relative wiki links.
const html = // <p><a href="#Main-Page">Main Page</a></p>
makeAllLinksAbsolute
Default: false
Render all wiki links as absolute links.
uriSuffix
Default: ``
Append this suffix to every URL.
const html = // <p><a href="./Main-Page.php">Main Page</a></p>
htmlAttributes
Default: {}
An object containing HTML attributes to be applied to every link.
const attrs = 'class': 'wikilink' 'rel': 'nofollow'const html = // <p><a href="Main-Page" class="wikilink" rel="nofollow">Main Page</a></p>