Skip to content

Feature request: multiple terms with different marks?  #34

@LaughingBubba

Description

@LaughingBubba

sooo ... an alternate syntax that goes something like this :

let searchMarks = {[
  {search:"abc", matchElement: "markOrange"},
  {search:"def", matchElement: "markBlue"},
  {search:"ghi", matchElement: "markYellow"},
]}

<Highlight searchMarks={searchMarks}>{sometext}</Highlight>

The requirement is to be able to use multiple search terms and define a separate highlight for each so different highlight colours can be used for each term.

I did have a go at nesting a Highlight tag with in itself (but with a different search and mark) but only the inner most Highlight seems to get executed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions