File tree 5 files changed +20
-2
lines changed
5 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,7 @@ export interface ConstructNameMap {
309
309
export type ConstructName = ConstructNameMap [ keyof ConstructNameMap ]
310
310
311
311
export { toMarkdown } from './lib/index.js'
312
+ export { handle as defaultHandlers } from './lib/handle/index.js'
312
313
export type {
313
314
Handle ,
314
315
Handlers ,
Original file line number Diff line number Diff line change 1
1
export { 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'
18
18
import { text } from './text.js'
19
19
import { thematicBreak } from './thematic-break.js'
20
20
21
+ /**
22
+ * Default (CommonMark) handlers.
23
+ */
21
24
export const handle = {
22
25
blockquote,
23
26
break : hardBreak ,
Original file line number Diff line number Diff line change 18
18
* [ Use] ( #use )
19
19
* [ API] ( #api )
20
20
* [ ` toMarkdown(tree[, options]) ` ] ( #tomarkdowntree-options )
21
+ * [ ` defaultHandlers ` ] ( #defaulthandlers )
21
22
* [ ` ConstructName ` ] ( #constructname )
22
23
* [ ` ConstructNameMap ` ] ( #constructnamemap )
23
24
* [ ` Handle ` ] ( #handle )
@@ -132,7 +133,7 @@ console.log(toMarkdown(tree))
132
133
133
134
## API
134
135
135
- This package exports the identifier ` toMarkdown ` .
136
+ This package exports the identifiers ` toMarkdown ` and ` defaultHandlers ` .
136
137
There is no default export.
137
138
138
139
### ` toMarkdown(tree[, options]) `
@@ -150,6 +151,10 @@ Turn an **[mdast][]** syntax tree into markdown.
150
151
151
152
Serialized markdown representing ` tree ` (` string ` ).
152
153
154
+ ### ` defaultHandlers `
155
+
156
+ Default (CommonMark) handlers ([ ` Handlers ` ] [ handlers ] ).
157
+
153
158
### ` ConstructName `
154
159
155
160
Construct names for things generated by ` mdast-util-to-markdown ` (TypeScript
@@ -167,7 +172,7 @@ type ConstructName = ConstructNameMap[keyof ConstructNameMap]
167
172
168
173
### ` ConstructNameMap `
169
174
170
- Interface of registered constructs.
175
+ Interface of registered constructs (TypeScript type) .
171
176
172
177
###### Type
173
178
Original file line number Diff line number Diff line change @@ -9,8 +9,16 @@ import test from 'node:test'
9
9
import { removePosition } from 'unist-util-remove-position'
10
10
import { fromMarkdown as from } from 'mdast-util-from-markdown'
11
11
import { toMarkdown as to } from '../index.js'
12
+ import * as api from '../index.js'
12
13
13
14
test ( '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
+
14
22
assert . equal (
15
23
to ( {
16
24
type : 'root' ,
You can’t perform that action at this time.
0 commit comments