Skip to content

Not correctly searching in nested elements #30

Open
@McPo

Description

@McPo

Im attempting to use react-linkify with react-highlight-words (https://github.com/bvaughn/react-highlight-words/blob/master/src/Highlighter.js)

However it appears linkify is not finding the text.

<Linkify properties={ { target: '_blank' } }><Highlighter searchWords={ this.props.highlight } textToHighlight={ msg.body }>{ msg.body }</Highlighter></Linkify>

Its not an issue with the resulting DOM, as mimicking the DOM as input still works.

<Linkify properties={ { target: '_blank' } }><span><span>{ msg.body }</span></span></Linkify>

It appears to be caused by the fact that react-highlight doesn't place the text as a child, but a prop instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions