Skip to content

Instantly share code, notes, and snippets.

@ahmedelgabri
Created March 25, 2020 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmedelgabri/97edd5ee0804504d5bbf78eb11d9c72e to your computer and use it in GitHub Desktop.
Save ahmedelgabri/97edd5ee0804504d5bbf78eb11d9c72e to your computer and use it in GitHub Desktop.
var unified = require('unified')
var markdown = require('remark-parse')
var remark2rehype = require('remark-rehype')
var html = require('rehype-stringify')
var report = require('vfile-reporter')
unified()
.use(markdown)
.use(remark2rehype)
.use(html)
.process('# Hello world!\n<blockquote>foo</blockquote>', function(err, file) {
console.error(report(err || file))
console.log(String(file))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment