Skip to content

Commit

Permalink
Update README.md (#204)
Browse files Browse the repository at this point in the history
Fix a bug in `Disable Header links` example section.

Given a heading:

```
# A demo of `react-markdown`
```

Example will yield:

```
<h1>A demo of</h1>
```

Which is not correct, the text `react-markdown` is ignored.

Withe the fix, example will yield correct output:

```
<h1>A demo of <code>react-markdown</code></h1>
```
  • Loading branch information
tnhu committed Sep 30, 2022
1 parent 1773402 commit 9805216
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -66,7 +66,7 @@ function Demo() {
source={source}
rehypeRewrite={(node, index, parent) => {
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
parent.children = [parent.children[1]];
parent.children = parent.children.slice(1)
}
}}
/>
Expand Down

0 comments on commit 9805216

Please sign in to comment.