File tree 4 files changed +15
-5
lines changed 4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import {toc} from 'mdast-util-toc'
21
21
export default function remarkToc ( options ) {
22
22
const settings = {
23
23
...options ,
24
- heading : ( options && options . heading ) || 'toc| table[ -]of[ -]contents?' ,
24
+ heading : ( options && options . heading ) || '( table[ -]of[ -])? contents?|toc ' ,
25
25
tight : options && typeof options . tight === 'boolean' ? options . tight : true
26
26
}
27
27
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ import remarkToc from 'remark-toc'
122
122
import {read } from ' to-vfile'
123
123
124
124
const file = await remark ()
125
- .use (remarkToc, {heading : ' contents ' } )
125
+ .use (remarkToc)
126
126
.process (await read (' example.md' ))
127
127
128
128
console .error (String (file))
@@ -193,7 +193,7 @@ Configuration (TypeScript type).
193
193
194
194
###### Fields
195
195
196
- * ` heading ` (` string ` , default: ` 'toc| table[ -]of[ -]contents?' ` )
196
+ * ` heading ` (` string ` , default: ` '( table[ -]of[ -])? contents?|toc ' ` )
197
197
— heading to look for, wrapped in ` new RegExp('^(' + value + ')$', 'i') `
198
198
* ` maxDepth ` (` number ` , default: ` 6 ` )
199
199
— max heading depth to include in the table of contents; this is inclusive:
262
262
1. [History](#history)
263
263
264
264
1. [Discovery](#discovery)
265
-
266
265
2. [Name and symbol](#name-and-symbol)
267
-
268
266
3. [Planet X disproved](#planet-x-disproved)
269
267
270
268
2. [Orbit](#orbit)
Original file line number Diff line number Diff line change
1
+ # Alpha
2
+
3
+ ## Contents
4
+
5
+ # Bravo
Original file line number Diff line number Diff line change
1
+ # Alpha
2
+
3
+ ## Contents
4
+
5
+ * [ Bravo] ( #bravo )
6
+
7
+ # Bravo
You can’t perform that action at this time.
0 commit comments