Skip to content

Commit

Permalink
docs: add explanation for each step in the example
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-rev authored Oct 26, 2024
1 parent 67a4313 commit fdbef6b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,17 @@ import { unified } from "unified";
const markdown = `
> Better to admit you walked through the wrong door than spend your life in the wrong room.
>
> @ [Josh Davis](https://somewhere.com) <a href="https://somewhere.com"></a>
> @ [Josh Davis](https://somewhere.com)
`;

const html = String(
await unified()
.use(remarkParse)
.use(remarkRehype)
.use(rehypeSemanticBlockquotes)
.use(rehypeStringify)
.use(rehypeFormat) // for demonstration purposes only
.process(markdown),
.use(remarkParse) // parse markdown
.use(remarkRehype) // convert markdown syntax tree into HTML syntax tree
.use(rehypeSemanticBlockquotes) // apply the plugin
.use(rehypeStringify) // convert HTML syntax tree into HTML
.use(rehypeFormat) // format HTML by adding insignificant whitespace
.process(markdown)
);

console.log(html);
Expand Down

0 comments on commit fdbef6b

Please sign in to comment.