Closed
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
3 and 4
Link to runnable example
https://codesandbox.io/s/hast-replace-error-fzuxo3?file=/error.spec.js
Steps to reproduce
The code sandbox has a broken test. It should not be broken.
Expected behavior
Both replaceme instances should be replaced.
Actual behavior
The first "replaceme" instance is replaced the 2nd bold instance of "replaceme" is not replaced. If I move the bold text earlier in the sentence there is no issue. If I make the text not bold there is also no issue.
I had trouble finding the bug in the sourcecode of this package. Maybe you can help out.
Runtime
Node v16, Node v14
Package manager
npm v7
OS
Linux
Build and bundle tools
Webpack, Parcel