Skip to content

Commit bd06667

Browse files
committed
Update @types/mdast, mdast utilities
1 parent e31f483 commit bd06667

File tree

3 files changed

+321
-295
lines changed

3 files changed

+321
-295
lines changed

lib/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
* @typedef {Extract<Root | Content, Parent>} Parents
1616
*/
1717

18-
import {listItem} from 'mdast-util-to-markdown/lib/handle/list-item.js'
19-
import {track} from 'mdast-util-to-markdown/lib/util/track.js'
18+
import {defaultHandlers} from 'mdast-util-to-markdown'
2019

2120
// To do: next major: rename `context` -> `state`, `safeOptions` -> `info`, use
2221
// `track` from `state`.
@@ -116,13 +115,13 @@ function listItemWithTaskListItem(node, parent, context, safeOptions) {
116115
const checkable =
117116
typeof node.checked === 'boolean' && head && head.type === 'paragraph'
118117
const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '
119-
const tracker = track(safeOptions)
118+
const tracker = context.createTracker(safeOptions)
120119

121120
if (checkable) {
122121
tracker.move(checkbox)
123122
}
124123

125-
let value = listItem(node, parent, context, {
124+
let value = defaultHandlers.listItem(node, parent, context, {
126125
...safeOptions,
127126
...tracker.current()
128127
})

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@
3939
"index.js"
4040
],
4141
"dependencies": {
42-
"@types/mdast": "^3.0.0",
43-
"mdast-util-to-markdown": "^1.3.0"
42+
"@types/mdast": "^4.0.0",
43+
"mdast-util-from-markdown": "^2.0.0",
44+
"mdast-util-to-markdown": "^2.0.0"
4445
},
4546
"devDependencies": {
4647
"@types/node": "^20.0.0",
47-
"c8": "^7.0.0",
48-
"mdast-util-from-markdown": "^1.0.0",
49-
"micromark-extension-gfm-task-list-item": "^1.0.0",
48+
"c8": "^8.0.0",
49+
"micromark-extension-gfm-task-list-item": "^2.0.0",
5050
"prettier": "^2.0.0",
5151
"remark-cli": "^11.0.0",
5252
"remark-preset-wooorm": "^9.0.0",
5353
"type-coverage": "^2.0.0",
5454
"typescript": "^5.0.0",
55-
"unist-util-remove-position": "^4.0.0",
55+
"unist-util-remove-position": "^5.0.0",
5656
"xo": "^0.54.0"
5757
},
5858
"scripts": {

0 commit comments

Comments
 (0)