Skip to content

Commit

Permalink
Update mdast-util-to-hast, @types/{hast,mdast}, unified, etc
Browse files Browse the repository at this point in the history
This removes the `all` and `one` exports, and changes how handlers work,
see:
<https://github.com/syntax-tree/mdast-util-to-hast/releases/tag/13.0.0>
  • Loading branch information
wooorm committed Sep 19, 2023
1 parent 102e10e commit acb292a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* @typedef {import('./lib/index.js').Processor} Processor
*/

export {defaultHandlers, all, one} from 'mdast-util-to-hast'
export {defaultHandlers} from 'mdast-util-to-hast'

export {default} from './lib/index.js'
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@
"index.js"
],
"dependencies": {
"@types/hast": "^2.0.0",
"@types/mdast": "^3.0.0",
"mdast-util-to-hast": "^12.1.0",
"unified": "^10.0.0"
"@types/hast": "^3.0.0",
"@types/mdast": "^4.0.0",
"mdast-util-to-hast": "^13.0.0",
"unified": "^11.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"c8": "^8.0.0",
"prettier": "^3.0.0",
"rehype-stringify": "^9.0.0",
"rehype-stringify": "^10.0.0",
"remark-cli": "^11.0.0",
"remark-parse": "^10.0.0",
"remark-parse": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"remark-stringify": "^10.0.0",
"remark-stringify": "^11.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.56.0"
Expand Down
12 changes: 1 addition & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ example.md: no issues found

## API

This package exports `defaultHandlers`, `all`, and `one`.
This package exports `defaultHandlers`.
The default export is `remarkRehype`.

### `unified().use(remarkRehype[, destination][, options])`
Expand Down Expand Up @@ -302,16 +302,6 @@ to the documentation available in [`mdast-util-to-hast`][mdast-util-to-hast].
The `defaultHandlers` export from [`mdast-util-to-hast`][mdast-util-to-hast],
useful when passing in your own handlers.

### `all`

The `all` export from [`mdast-util-to-hast`][mdast-util-to-hast],
useful when passing in your own handlers.

### `one`

The `one` export from [`mdast-util-to-hast`][mdast-util-to-hast],
useful when passing in your own handlers.

## Examples

### Example: supporting HTML in markdown naïvely
Expand Down
4 changes: 1 addition & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ import remarkRehype from './index.js'
test('remarkRehype', async function (t) {
await t.test('should expose the public api', async function () {
assert.deepEqual(Object.keys(await import('./index.js')).sort(), [
'all',
'default',
'defaultHandlers',
'one'
'defaultHandlers'
])
})

Expand Down

0 comments on commit acb292a

Please sign in to comment.