What is micromark-extension-gfm-strikethrough?
The micromark-extension-gfm-strikethrough package is an extension for the micromark Markdown parser that adds support for GitHub Flavored Markdown (GFM) strikethrough syntax. This allows users to parse and render strikethrough text in Markdown documents according to the GFM specification.
What are micromark-extension-gfm-strikethrough's main functionalities?
Strikethrough Syntax Parsing
This feature allows the parsing of strikethrough syntax (~~strikethrough~~) in Markdown and converts it to the appropriate HTML <del> tag.
import { micromark } from 'micromark';
import { gfmStrikethrough } from 'micromark-extension-gfm-strikethrough';
const markdown = 'This is ~~strikethrough~~ text.';
const html = micromark(markdown, {
extensions: [gfmStrikethrough()]
});
console.log(html); // Outputs: 'This is <del>strikethrough</del> text.'
Other packages similar to micromark-extension-gfm-strikethrough
markdown-it
markdown-it is a Markdown parser with a plugin system. It has a plugin called markdown-it-mark that can handle strikethrough syntax similar to micromark-extension-gfm-strikethrough. However, markdown-it is a full parser, whereas micromark-extension-gfm-strikethrough is an extension for the micromark parser.
remark-gfm
remark-gfm is a plugin for the remark Markdown processor that adds support for GFM features, including strikethrough. It is similar to micromark-extension-gfm-strikethrough but is designed to work with the remark ecosystem.
showdown
showdown is another Markdown to HTML converter that can be extended with plugins. It has built-in support for GFM strikethrough without the need for additional plugins, offering similar functionality to micromark-extension-gfm-strikethrough.
micromark-extension-gfm-strikethrough
micromark extension to support GitHub flavored markdown strikethrough
(like this).
This package provides the low-level modules for integrating with the micromark
tokenizer and the micromark HTML compiler.
While GFM defines strikethrough, GitHub does not adhere to their
specification.
This syntax extension matches the GitHub parser, not the specification.
You probably shouldn’t use this package directly, but instead use
mdast-util-gfm-strikethrough
with
mdast.
Install
npm:
npm install micromark-extension-gfm-strikethrough
API
syntax
html
Note: syntax
is the default export of this module, html is available at
micromark-extension-gfm-strikethrough/html
.
Support strikethrough (like this)
The exports are extensions, respectively for the micromark parser (to tokenize
strikethrough, can be passed in extensions
) and the default HTML compiler
(to compile as a <del>
element, can be passed in htmlExtensions
).
Related
Contribute
See contributing.md
in micromark/.github
for ways to get
started.
See support.md
for ways to get help.
This project has a code of conduct.
By interacting with this repository, organization, or community you agree to
abide by its terms.
License
MIT © Titus Wormer