Created
March 25, 2020 16:42
-
-
Save ahmedelgabri/97edd5ee0804504d5bbf78eb11d9c72e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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