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 6b2e753 commit 8c7c408Copy full SHA for 8c7c408
readme.md
@@ -79,15 +79,12 @@ Say our document `example.html` contains:
79
80
```js
81
import fs from 'node:fs/promises'
82
-import {unified} from 'unified'
83
-import rehypeParse from 'rehype-parse'
+import {fromHtml} from 'hast-util-from-html'
84
import {toXast} from 'hast-util-to-xast'
85
import {toXml} from 'xast-util-to-xml'
86
87
// Get the HTML syntax tree:
88
-const hast = unified()
89
- .use(rehypeParse)
90
- .parse(await fs.readFile('example.html'))
+const hast = fromHtml(await fs.readFile('example.html'))
91
92
// Turn hast to xast:
93
const xast = toXast(hast)
0 commit comments