Skip to content

Commit 3236b1e

Browse files
authored
Add defaultHandlers export
Closes GH-58. Reviewed-by: Titus Wormer <[email protected]> Reviewed-by: Christian Murphy <[email protected]>
1 parent 893958f commit 3236b1e

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
*/
88

99
export {one, all} from './lib/traverse.js'
10-
export {toHast} from './lib/index.js'
10+
export {defaultHandlers, toHast} from './lib/index.js'

lib/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ import {one} from './traverse.js'
9999
import {footer} from './footer.js'
100100
import {handlers} from './handlers/index.js'
101101

102+
export {handlers as defaultHandlers}
103+
102104
const own = {}.hasOwnProperty
103105

104106
/**

readme.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Which when running with `node example` yields:
5454

5555
## API
5656

57-
This package exports the following identifiers: `toHast`, `all`, `one`
57+
This package exports the following identifiers: `toHast`, `defaultHandlers`, `all`, `one`
5858
There is no default export.
5959

6060
### `toHast(node[, options])`
@@ -244,6 +244,11 @@ Yields, in [hast][] (**note**: the `pre` and `language-js` class are normal
244244
}
245245
```
246246

247+
### `defaultHandlers`
248+
249+
Object mapping mdast node types to functions that can handle them.
250+
See [`lib/handlers/index.js`](./lib/handlers/index.js)
251+
247252
### `all(h, parent)`
248253

249254
Helper function for writing custom handlers passed to `options.handlers`.

0 commit comments

Comments
 (0)