🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
34
node_modules/remark-gfm/index.js
generated
vendored
Normal file
34
node_modules/remark-gfm/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* @typedef {import('mdast').Root} Root
|
||||
* @typedef {import('micromark-extension-gfm').Options & import('mdast-util-gfm').Options} Options
|
||||
*/
|
||||
|
||||
import {gfm} from 'micromark-extension-gfm'
|
||||
import {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'
|
||||
|
||||
/**
|
||||
* Plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists).
|
||||
*
|
||||
* @type {import('unified').Plugin<[Options?]|void[], Root>}
|
||||
*/
|
||||
export default function remarkGfm(options = {}) {
|
||||
const data = this.data()
|
||||
|
||||
add('micromarkExtensions', gfm(options))
|
||||
add('fromMarkdownExtensions', gfmFromMarkdown())
|
||||
add('toMarkdownExtensions', gfmToMarkdown(options))
|
||||
|
||||
/**
|
||||
* @param {string} field
|
||||
* @param {unknown} value
|
||||
*/
|
||||
function add(field, value) {
|
||||
const list = /** @type {unknown[]} */ (
|
||||
// Other extensions
|
||||
/* c8 ignore next 2 */
|
||||
data[field] ? data[field] : (data[field] = [])
|
||||
)
|
||||
|
||||
list.push(value)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue