Skip to content

Commit 9805216

Browse files
authoredSep 30, 2022
Update README.md (#204)
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> ```
1 parent 1773402 commit 9805216

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function Demo() {
6666
source={source}
6767
rehypeRewrite={(node, index, parent) => {
6868
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
69-
parent.children = [parent.children[1]];
69+
parent.children = parent.children.slice(1)
7070
}
7171
}}
7272
/>

0 commit comments

Comments
 (0)
Please sign in to comment.