Skip to content

Commit

Permalink
Update @types/mdast, mdast utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 10, 2023
1 parent e31f483 commit bd06667
Show file tree
Hide file tree
Showing 3 changed files with 321 additions and 295 deletions.
7 changes: 3 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
* @typedef {Extract<Root | Content, Parent>} Parents
*/

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

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

if (checkable) {
tracker.move(checkbox)
}

let value = listItem(node, parent, context, {
let value = defaultHandlers.listItem(node, parent, context, {
...safeOptions,
...tracker.current()
})
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@
"index.js"
],
"dependencies": {
"@types/mdast": "^3.0.0",
"mdast-util-to-markdown": "^1.3.0"
"@types/mdast": "^4.0.0",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-to-markdown": "^2.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"c8": "^7.0.0",
"mdast-util-from-markdown": "^1.0.0",
"micromark-extension-gfm-task-list-item": "^1.0.0",
"c8": "^8.0.0",
"micromark-extension-gfm-task-list-item": "^2.0.0",
"prettier": "^2.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"unist-util-remove-position": "^4.0.0",
"unist-util-remove-position": "^5.0.0",
"xo": "^0.54.0"
},
"scripts": {
Expand Down
Loading

0 comments on commit bd06667

Please sign in to comment.