You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @property {boolean} [tight=false] Whether to compile list-items tightly.
11
+
* @property {boolean} [ordered=false] Whether to compile list-items as an ordered list, otherwise they are unordered.
12
+
* @property {string} [prefix=null] Add a prefix to links to headings in the table of contents. Useful for example when later going from mdast to hast and sanitizing with `hast-util-sanitize`.
13
+
*/
14
+
1
15
importextendfrom'extend'
2
16
3
-
// Transform a list of heading objects to a markdown list.
4
-
exportfunctioncontents(map,tight,prefix,ordered){
17
+
/**
18
+
* Transform a list of heading objects to a markdown list.
* @property {string} [skip] Headings to skip, wrapped in `new RegExp('^(' + value + ')$', 'i')`. Any heading matching this expression will not be present in the table of contents.
* @property {Heading['depth']} [maxDepth=6] Maximum heading depth to include in the table of contents. This is inclusive: when set to `3`, level three headings are included (those with three hashes, `###`).
14
+
*
15
+
* @typedef SearchEntry
16
+
* @property {Heading['depth']} depth
17
+
* @property {Array.<PhrasingContent>} children
18
+
* @property {string} id
19
+
*
20
+
* @typedef SearchResult
21
+
* @property {number} index
22
+
* @property {number} endIndex
23
+
* @property {Array.<SearchEntry>} map
24
+
*/
25
+
1
26
importSluggerfrom'github-slugger'
2
27
import{toString}from'mdast-util-to-string'
3
28
import{visit}from'unist-util-visit'
@@ -6,33 +31,45 @@ import {toExpression} from './to-expression.js'
0 commit comments