|
6 | 6 |
|
7 | 7 | import assert from 'node:assert' |
8 | 8 | import test from 'tape' |
9 | | -import {remark} from 'remark' |
10 | | -import gfm from 'remark-gfm' |
| 9 | +import {fromMarkdown} from 'mdast-util-from-markdown' |
| 10 | +import {gfmFromMarkdown} from 'mdast-util-gfm' |
| 11 | +import {gfm} from 'micromark-extension-gfm' |
11 | 12 | import {visit, CONTINUE, EXIT, SKIP} from './index.js' |
12 | 13 |
|
13 | | -const tree = remark().parse('Some _emphasis_, **importance**, and `code`.') |
| 14 | +const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.') |
14 | 15 |
|
15 | 16 | const stopIndex = 5 |
16 | 17 | const skipIndex = 7 |
@@ -425,14 +426,13 @@ test('unist-util-visit', (t) => { |
425 | 426 | }) |
426 | 427 |
|
427 | 428 | t.test('should visit added nodes', (t) => { |
428 | | - const tree = remark().parse('Some _emphasis_, **importance**, and `code`.') |
429 | | - |
430 | | - // Unified doesn't know parse result type, |
431 | | - // all we know is that it's a node, but we know it is a parent, so we |
432 | | - // assert that here |
433 | | - const other = /** @type{Parent} */ ( |
434 | | - remark().use(gfm).parse('Another ~~sentence~~.') |
435 | | - ).children[0] |
| 429 | + const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.') |
| 430 | + const other = /** @type {Parent} */ ( |
| 431 | + fromMarkdown('Another ~~sentence~~.', { |
| 432 | + extensions: [gfm()], |
| 433 | + mdastExtensions: [gfmFromMarkdown()] |
| 434 | + }).children[0] |
| 435 | + ) |
436 | 436 |
|
437 | 437 | const l = types.length + 5 // (p, text, delete, text, text) |
438 | 438 | let n = 0 |
|
0 commit comments