Skip to content

Commit

Permalink
doc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 2, 2021
1 parent f3a5033 commit 1a120c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const htmlStr = unified()
.use(rehypeRaw)
.use(rehypeRewrite, {
rewrite: (node) => {
if (node.type == 'element' && node.tagName == 'p') {
if (node.type == 'element' && node.tagName == 'h1') {
node.properties = { ...node.properties, style: 'color:red;' }
}
}
Expand All @@ -221,7 +221,7 @@ const htmlStr = unified()
> **`Output:`**
>
> ```html
> <p style="color:red;">Hello World!</p>
> <h1 style="color:red;">Hello World!</h1>
> ```
>
Expand Down

0 comments on commit 1a120c5

Please sign in to comment.