Skip to content

Very particular situation results in some text not being replaced #3

Closed
@0xR

Description

@0xR

Initial checklist

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions