File tree Expand file tree Collapse file tree 5 files changed +20
-2
lines changed Expand file tree Collapse file tree 5 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,7 @@ export interface ConstructNameMap {
309309export type ConstructName = ConstructNameMap [ keyof ConstructNameMap ]
310310
311311export { toMarkdown } from './lib/index.js'
312+ export { handle as defaultHandlers } from './lib/handle/index.js'
312313export type {
313314 Handle ,
314315 Handlers ,
Original file line number Diff line number Diff line change 11export { toMarkdown } from './lib/index.js'
2+ export { handle as defaultHandlers } from './lib/handle/index.js'
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ import {strong} from './strong.js'
1818import { text } from './text.js'
1919import { thematicBreak } from './thematic-break.js'
2020
21+ /**
22+ * Default (CommonMark) handlers.
23+ */
2124export const handle = {
2225 blockquote,
2326 break : hardBreak ,
Original file line number Diff line number Diff line change 1818* [ Use] ( #use )
1919* [ API] ( #api )
2020 * [ ` toMarkdown(tree[, options]) ` ] ( #tomarkdowntree-options )
21+ * [ ` defaultHandlers ` ] ( #defaulthandlers )
2122 * [ ` ConstructName ` ] ( #constructname )
2223 * [ ` ConstructNameMap ` ] ( #constructnamemap )
2324 * [ ` Handle ` ] ( #handle )
@@ -132,7 +133,7 @@ console.log(toMarkdown(tree))
132133
133134## API
134135
135- This package exports the identifier ` toMarkdown ` .
136+ This package exports the identifiers ` toMarkdown ` and ` defaultHandlers ` .
136137There is no default export.
137138
138139### ` toMarkdown(tree[, options]) `
@@ -150,6 +151,10 @@ Turn an **[mdast][]** syntax tree into markdown.
150151
151152Serialized markdown representing ` tree ` (` string ` ).
152153
154+ ### ` defaultHandlers `
155+
156+ Default (CommonMark) handlers ([ ` Handlers ` ] [ handlers ] ).
157+
153158### ` ConstructName `
154159
155160Construct names for things generated by ` mdast-util-to-markdown ` (TypeScript
@@ -167,7 +172,7 @@ type ConstructName = ConstructNameMap[keyof ConstructNameMap]
167172
168173### ` ConstructNameMap `
169174
170- Interface of registered constructs.
175+ Interface of registered constructs (TypeScript type) .
171176
172177###### Type
173178
Original file line number Diff line number Diff line change @@ -9,8 +9,16 @@ import test from 'node:test'
99import { removePosition } from 'unist-util-remove-position'
1010import { fromMarkdown as from } from 'mdast-util-from-markdown'
1111import { toMarkdown as to } from '../index.js'
12+ import * as api from '../index.js'
1213
1314test ( 'core' , ( ) => {
15+ const identifiers = Object . keys ( api )
16+ assert . ok ( identifiers . includes ( 'toMarkdown' ) , 'should expose `toMarkdown`' )
17+ assert . ok (
18+ identifiers . includes ( 'defaultHandlers' ) ,
19+ 'should expose `defaultHandlers`'
20+ )
21+
1422 assert . equal (
1523 to ( {
1624 type : 'root' ,
You can’t perform that action at this time.
0 commit comments