You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug with remark-rehype or rehype-raw. Please forgive me if I got it wrong.
The issue is that HTML comments with an odd number of - characters is not parsed properly. If you feed the following code through remark-rehype and rehype-raw:
<!-- An HTML comment with 2 dashes -->
# This heading works (2 dashes)
You will get a proper parsed heading. However, if you use 3 dashes, like this:
<!--- An HTML comment with 3 dashes --->
# This heading is broken (3 dashes)
Initial checklist
Affected packages and versions
6.1.0
Link to runnable example
https://codesandbox.io/s/remark-rehype-debug-forked-8tk7h?file=/src/index.js
Steps to reproduce
I'm not sure if this is a bug with
remark-rehype
orrehype-raw
. Please forgive me if I got it wrong.The issue is that HTML comments with an odd number of
-
characters is not parsed properly. If you feed the following code throughremark-rehype
andrehype-raw
:You will get a proper parsed heading. However, if you use 3 dashes, like this:
Then you get no parsed content at all.
The pattern repeats. 4 dashes works, 5 doesn't, 6 works, 7 doesn't, etc...
Expected behavior
Any number of dashes in the
<!---- --->
comment tag should be supported.Actual behavior
Only even numbers of dashes are parsed properly.
Runtime
Node v16
Package manager
yarn v1
OS
macOS
Build and bundle tools
Webpack
The text was updated successfully, but these errors were encountered: