Update @types/mdast
, unified
, utilities
This commit is contained in:
parent
c223cd8e31
commit
a952370494
3 changed files with 13 additions and 16 deletions
15
index.js
15
index.js
|
@ -1,11 +1,14 @@
|
||||||
|
/// <reference types="remark-parse" />
|
||||||
|
/// <reference types="remark-stringify" />
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import('mdast').Root} Root
|
* @typedef {import('mdast').Root} Root
|
||||||
* @typedef {import('mdast-util-directive')} DoNotTouchAsThisImportIncludesDirectivesInTree
|
* @typedef {import('mdast-util-directive')} DoNotTouchAsThisImportIncludesDirectivesInTree
|
||||||
* @typedef {import('unified').Processor<Root>} Processor
|
* @typedef {import('unified').Processor<Root>} Processor
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {directive} from 'micromark-extension-directive'
|
|
||||||
import {directiveFromMarkdown, directiveToMarkdown} from 'mdast-util-directive'
|
import {directiveFromMarkdown, directiveToMarkdown} from 'mdast-util-directive'
|
||||||
|
import {directive} from 'micromark-extension-directive'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add support for generic directives.
|
* Add support for generic directives.
|
||||||
|
@ -23,20 +26,14 @@ export default function remarkDirective() {
|
||||||
const self = /** @type {Processor} */ (this)
|
const self = /** @type {Processor} */ (this)
|
||||||
const data = self.data()
|
const data = self.data()
|
||||||
|
|
||||||
/** @type {Array<unknown>} */
|
|
||||||
// @ts-expect-error: to do: remove.
|
|
||||||
const micromarkExtensions =
|
const micromarkExtensions =
|
||||||
data.micromarkExtensions || (data.micromarkExtensions = [])
|
data.micromarkExtensions || (data.micromarkExtensions = [])
|
||||||
/** @type {Array<unknown>} */
|
|
||||||
// @ts-expect-error: to do: remove.
|
|
||||||
const fromMarkdownExtensions =
|
const fromMarkdownExtensions =
|
||||||
data.fromMarkdownExtensions || (data.fromMarkdownExtensions = [])
|
data.fromMarkdownExtensions || (data.fromMarkdownExtensions = [])
|
||||||
/** @type {Array<unknown>} */
|
|
||||||
// @ts-expect-error: to do: remove.
|
|
||||||
const toMarkdownExtensions =
|
const toMarkdownExtensions =
|
||||||
data.toMarkdownExtensions || (data.toMarkdownExtensions = [])
|
data.toMarkdownExtensions || (data.toMarkdownExtensions = [])
|
||||||
|
|
||||||
micromarkExtensions.push(directive())
|
micromarkExtensions.push(directive())
|
||||||
fromMarkdownExtensions.push(directiveFromMarkdown)
|
fromMarkdownExtensions.push(directiveFromMarkdown())
|
||||||
toMarkdownExtensions.push(directiveToMarkdown)
|
toMarkdownExtensions.push(directiveToMarkdown())
|
||||||
}
|
}
|
||||||
|
|
12
package.json
12
package.json
|
@ -33,20 +33,20 @@
|
||||||
"index.js"
|
"index.js"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/mdast": "^3.0.0",
|
"@types/mdast": "^4.0.0",
|
||||||
"mdast-util-directive": "^2.0.0",
|
"mdast-util-directive": "^3.0.0",
|
||||||
"micromark-extension-directive": "^2.0.0",
|
"micromark-extension-directive": "^3.0.0",
|
||||||
"unified": "^10.0.0"
|
"unified": "^11.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.0.0",
|
"@types/node": "^20.0.0",
|
||||||
"c8": "^8.0.0",
|
"c8": "^8.0.0",
|
||||||
"is-hidden": "^2.0.0",
|
"is-hidden": "^2.0.0",
|
||||||
"prettier": "^3.0.0",
|
"prettier": "^3.0.0",
|
||||||
"remark": "^14.0.0",
|
"remark": "^15.0.0",
|
||||||
"remark-cli": "^11.0.0",
|
"remark-cli": "^11.0.0",
|
||||||
"remark-preset-wooorm": "^9.0.0",
|
"remark-preset-wooorm": "^9.0.0",
|
||||||
"to-vfile": "^7.0.0",
|
"to-vfile": "^8.0.0",
|
||||||
"type-coverage": "^2.0.0",
|
"type-coverage": "^2.0.0",
|
||||||
"typescript": "^5.0.0",
|
"typescript": "^5.0.0",
|
||||||
"xo": "^0.56.0"
|
"xo": "^0.56.0"
|
||||||
|
|
2
test/fixtures/container/output.md
vendored
2
test/fixtures/container/output.md
vendored
|
@ -30,7 +30,7 @@ b
|
||||||
d
|
d
|
||||||
|
|
||||||
:::e
|
:::e
|
||||||
* * f
|
* * f
|
||||||
:::
|
:::
|
||||||
|
|
||||||
> g h
|
> g h
|
||||||
|
|
Loading…
Add table
Reference in a new issue