site/node_modules/micromark-extension-gfm-strikethrough/dev/lib/html.js

27 lines
567 B
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
/**
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
*/
/**
* Create an HTML extension for `micromark` to support GFM strikethrough when
* serializing to HTML.
*
* @returns {HtmlExtension}
* Extension for `micromark` that can be passed in `htmlExtensions`, to
* support GFM strikethrough when serializing to HTML.
*/
export function gfmStrikethroughHtml() {
return {
enter: {
strikethrough() {
this.tag('<del>')
}
},
exit: {
strikethrough() {
this.tag('</del>')
}
}
}
}