Closed as not planned
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
mdast-util-find-and-replace@3.0.0
Link to runnable example
Steps to reproduce
See new unit test in PR above. The search string is the regular expression /(emph|sis)/
and the replacement text is 'foo'
. So the text node with the content 'emphasis'
should be replaced with three new text nodes, with the contents 'foo'
, 'a'
, and 'foo'
, respectively.
Expected behavior
The test should pass.
Actual behavior
The test fails because only the first match is replaced, resulting in only two nodes with the contents 'foo'
and 'asis'
, respectively.
Affected runtime and version
node@18.17.1
Affected package manager and version
npm@10.1.0
Affected OS and version
macOS Ventura 13.5.2
Build and bundle tools
No response