micromark-extension-wikilink-syntax
v2.1.1
Published
Syntax-only [micromark][] extension for parsing [Obsidian][]-style wikilinks and embeds whose aliases/alt text can contain markdown.
Downloads
41
Maintainers
Readme
micromark-extension-wikilink-syntax
Syntax-only micromark extension for parsing Obsidian-style wikilinks and embeds whose aliases/alt text can contain markdown.
Note this extension does not extend the html compiler. Instead, this is intended to be used together with mdast-util-wikilink-syntax to output syntax trees, which can then be replaced with the appropriate construct using unist-util-visit
Install
This package is ESM only. In Node.js (version 16+), install with npm:
npm install micromark-extension-wikilink-syntaxIn Deno with esm.sh:
import { wikilink } from "https://esm.sh/micromark-extension-wikilink-syntax@1";In browsers with esm.sh:
<script type="module">
import { wikilink } from "https://esm.sh/micromark-extension-gfm-strikethrough@1?bundle";
</script>API
This package exports the identifier wikilink.
There is no default export.
The export map supports the development condition.
Run node --conditions development module.js to get instrumented dev code.
Without this condition, production code is loaded.
wikilink(options?)
Create an extension for micromark to parse wikilink syntax.
options.aliasDivider
The divider between the destination and the alias.
Default is 124, the codepoint for |.
[[destination|alias]]options.gfmCompat
Set to true to make aliased wikilinks usable within GFM tables.
See this example.
Returns
Extension for micromark that can be passed in extensions,
to enable wikilinks (Extension).
Security
This package is safe.
