Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Dec 6, 2022
1 parent 11e1ac2 commit b527e60
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ A mix of *markdown* and <em>HTML</em>.
</div>
```

And our module `example.js` looks as follows:
…and our module `example.js` looks as follows:

```js
import {read} from 'to-vfile'
Expand All @@ -115,23 +115,19 @@ import rehypeDocument from 'rehype-document'
import rehypeFormat from 'rehype-format'
import rehypeStringify from 'rehype-stringify'

main()
const file = await unified()
.use(remarkParse)
.use(remarkRehype, {allowDangerousHtml: true})
.use(rehypeRaw)
.use(rehypeDocument, {title: '🙌'})
.use(rehypeFormat)
.use(rehypeStringify)
.process(await read('example.md'))

async function main() {
const file = await unified()
.use(remarkParse)
.use(remarkRehype, {allowDangerousHtml: true})
.use(rehypeRaw)
.use(rehypeDocument, {title: '🙌'})
.use(rehypeFormat)
.use(rehypeStringify)
.process(await read('example.md'))

console.log(String(file))
}
console.log(String(file))
```

Now running `node example.js` yields:
…now running `node example.js` yields:

```html
<!doctype html>
Expand Down

0 comments on commit b527e60

Please sign in to comment.