File tree Expand file tree Collapse file tree 4 files changed +15
-5
lines changed
Expand file tree Collapse file tree 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'
2121export default function remarkToc ( options ) {
2222 const settings = {
2323 ...options ,
24- heading : ( options && options . heading ) || 'toc| table[ -]of[ -]contents?' ,
24+ heading : ( options && options . heading ) || '( table[ -]of[ -])? contents?|toc ' ,
2525 tight : options && typeof options . tight === 'boolean' ? options . tight : true
2626 }
2727
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ import remarkToc from 'remark-toc'
122122import {read } from ' to-vfile'
123123
124124const file = await remark ()
125- .use (remarkToc, {heading : ' contents ' } )
125+ .use (remarkToc)
126126 .process (await read (' example.md' ))
127127
128128console .error (String (file))
@@ -193,7 +193,7 @@ Configuration (TypeScript type).
193193
194194###### Fields
195195
196- * ` heading ` (` string ` , default: ` 'toc| table[ -]of[ -]contents?' ` )
196+ * ` heading ` (` string ` , default: ` '( table[ -]of[ -])? contents?|toc ' ` )
197197 — heading to look for, wrapped in ` new RegExp('^(' + value + ')$', 'i') `
198198* ` maxDepth ` (` number ` , default: ` 6 ` )
199199 — max heading depth to include in the table of contents; this is inclusive:
2622621 . [ History] ( #history )
263263
264264 1 . [ Discovery] ( #discovery )
265-
266265 2 . [ Name and symbol] ( #name-and-symbol )
267-
268266 3 . [ Planet X disproved] ( #planet-x-disproved )
269267
2702682 . [ 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