remark-rehypedoesn’t deal with HTML inside the markdown. You’ll need
rehype-rawif you’re planning on doing that.
npm install remark-rehype
Say we have the following file,
# Hello world> Block quote.Some _emphasis_, **importance**, and `code`.
And our script,
example.js, looks as follows:
var vfile = ;var report = ;var unified = ;var markdown = ;var remark2rehype = ;var doc = ;var format = ;var html = ;;
node example yields:
example.md: no issues foundexampleHello worldBlock quote.Some emphasis, importance, and code.
origin.use(remark2rehype[, destination][, options])
If given (
Unified), runs the destination processor
with the new HAST tree, then, after running discards that tree and
continues on running the origin processor with the original tree
(bridge-mode). Otherwise, passes the tree to further
options are passed through to
mdast-util-to-hast, if given.
rehype-raw— Properly deal with HTML in markdown (used after
rehype-remark— Transform HTML to markdown
rehype-retext— Transform HTML to NLCST
remark-retext— Transform markdown to NLCST