Skip to content

Manually call text highlighting with text to highlight #9603

Answered by wewhite
DFournierIT asked this question in Q&A
Discussion options

You must be logged in to vote

Yes it can be called manually, since v4.0.7
See this: Texthighlight plugin #6126
And this PR: Text Highlight: added support for arrays and added more test cases #6137
This comment states it still needs to be documented: #6126 (comment)

Basically, you can do this in JavaScript, calling the plugin manually, looks like this:


    // get the pre-defined area to search and highlight
    const elm = document.getElementById("searchAbleArea");

    // define strings to search for
    var $searchCriteria1 = 'style'; // single string
    var $searchCriteria2 = ['style','words', 'to', 'be', 'highlighted']; // string array
    var $searchCriteria3 = 'style|words|to|be|highlighted'; // this or that

 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DFournierIT
Comment options

Answer selected by DFournierIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants