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

25 lines
478 B
JavaScript
Raw Normal View History

2023-07-19 21:31:30 +02:00
/**
* @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
*/
// To do: next major: expose function instead of object.
/**
* Extension for `micromark` that can be passed in `htmlExtensions`, to
* support GFM strikethrough when serializing to HTML.
*
* @type {HtmlExtension}
*/
export const gfmStrikethroughHtml = {
enter: {
strikethrough() {
this.tag('<del>')
}
},
exit: {
strikethrough() {
this.tag('</del>')
}
}
}