We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b98ae83 commit e3a6d9aCopy full SHA for e3a6d9a
example/example.js
@@ -1,4 +1,5 @@
1
import {remark} from 'remark'
2
+import {is} from 'unist-util-is';
3
import replaceBetween from '../index.js';
4
5
const markdown = `
@@ -42,10 +43,17 @@ const plugin = () => (tree) => {
42
43
44
// Get lists between `start` and `end`
45
replaceBetween(tree, start, end, list => {
- console.log(list)
46
+ // Remove both `tabs` mention
47
+ list.shift();
48
+ list.pop()
49
+
50
+ const headerIndexes = list
51
+ .map((node, i) => is(node, {type: 'heading'}) && i)
52
+ .filter(Number.isInteger)
53
54
return [{
55
type: 'html',
- value: '<p>Testing</p>'
56
+ value: headerIndexes
57
}]
58
});
59
0 commit comments