🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
23
node_modules/remark-smartypants/index.js
generated
vendored
Normal file
23
node_modules/remark-smartypants/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/**
|
||||
* @typedef {import('mdast').Root} Root
|
||||
* @typedef {import('retext-smartypants').Options} Options
|
||||
*/
|
||||
|
||||
import { retext } from 'retext'
|
||||
import { visit } from 'unist-util-visit'
|
||||
import smartypants from 'retext-smartypants'
|
||||
|
||||
/**
|
||||
* remark plugin to implement SmartyPants.
|
||||
*
|
||||
* @type {import('unified').Plugin<[Options?] | void[], Root>}
|
||||
*/
|
||||
export default function remarkSmartypants(options) {
|
||||
const processor = retext().use(smartypants, options)
|
||||
const transformer = tree => {
|
||||
visit(tree, 'text', node => {
|
||||
node.value = String(processor.processSync(node.value))
|
||||
})
|
||||
}
|
||||
return transformer
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue