🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
7
node_modules/rehype-stringify/lib/index.d.ts
generated
vendored
Normal file
7
node_modules/rehype-stringify/lib/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/** @type {import('unified').Plugin<[Options?]|Array<void>, Node, string>} */
|
||||
export default function rehypeStringify(
|
||||
config: void | import('hast-util-to-html/lib/types').Options | undefined
|
||||
): void
|
||||
export type Root = import('hast').Root
|
||||
export type Node = Root | Root['children'][number]
|
||||
export type Options = import('hast-util-to-html').Options
|
||||
22
node_modules/rehype-stringify/lib/index.js
generated
vendored
Normal file
22
node_modules/rehype-stringify/lib/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* @typedef {import('hast').Root} Root
|
||||
* @typedef {Root|Root['children'][number]} Node
|
||||
* @typedef {import('hast-util-to-html').Options} Options
|
||||
*/
|
||||
|
||||
import {toHtml} from 'hast-util-to-html'
|
||||
|
||||
/** @type {import('unified').Plugin<[Options?]|Array<void>, Node, string>} */
|
||||
export default function rehypeStringify(config) {
|
||||
const processorSettings = /** @type {Options} */ (this.data('settings'))
|
||||
const settings = Object.assign({}, processorSettings, config)
|
||||
|
||||
Object.assign(this, {Compiler: compiler})
|
||||
|
||||
/**
|
||||
* @type {import('unified').CompilerFunction<Node, string>}
|
||||
*/
|
||||
function compiler(tree) {
|
||||
return toHtml(tree, settings)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue