Questions tagged [mark.js]

JavaScript keyword highlighter

JavaScript keyword highlighter Search term highlighting intended for every use case. It can be used with plain JavaScript or as jQuery plugin. Refer https://markjs.io/

13 questions
1
vote
0 answers

after typing in a word the cursor jumps to the beginning of that word

I'm working on a "text-checker" while using Mark.js. The issue I am having is, that once I input the word and it gets marked/highlighted the cursor jumps to the beginning of that word. Here is an example. Maybe the solution would be to somehow save…
WeAreDoomed
  • 248
  • 1
  • 14
1
vote
1 answer

Mark.js contenteditable - run Mark on input

I'm am making a "word-checker" with a contenteditable div while using mark.js to highlingt certain words/word groups. The problem I am having is that I can't find a way to "run" Mark.js as the words are being typed (copy/pasted) in. I have tried to…
WeAreDoomed
  • 248
  • 1
  • 14
1
vote
1 answer

mark.js markRanges() not respecting HTML elements

I'm using mark.js's markRanges() method to highlight ranges with a start position and length, however, it's not respecting HTML elements such as line break elements. The documentation notes that start positions must be specified including whitespace…
1
vote
0 answers

mark.js not highlighting a word inside brackets?

I am trying marker.js to highlight the containing word inside brackets given the user query. For instance, when the user gives a query "How covid-19 originated?" and in the answer response: Coronavirus disease 2019 (COVID‑19) is an infectious…
HQuser
  • 640
  • 10
  • 26
0
votes
1 answer

How to dynamically highlight changing numbers?

I have been searching for days now. I have some random numbers that are generated automatically with crunch function on 3 minute interval: setInterval(crunch, 180000); then I can nicely highlight the return random numbers with mark.js: $(function()…
0
votes
1 answer

How to pass HTML tags content to mark.js and separate them with a space or a comma?

I'm using the mark.js library to highlight keywords on a page, this works fine but I need to add an extra space or a comma after each tag h1, h2, etc.. First I thought about a loop like this, but the mark's library doesn't like it and have this…
Seb
  • 93
  • 3
  • 14
0
votes
1 answer

jQuery to Javascript/Vue

I want to create a custom search box that can jump to its matches using mark.js mark.js web page. They do have an example here: https://jsfiddle.net/julmot/973gdh8g/ But it is written using jQuery. I tried converting it to JS/Vue (using Quasar), but…
kzaiwo
  • 1,558
  • 1
  • 16
  • 45
0
votes
1 answer

I need to exclude the specific two-character string `[?` from a regex match search

I am using this regex string to find all periods and exclamation and question marks that have white space around them or are not part of decimals: /\.(?=\s|$)|\?(?=\s|$)|\!(?=\s|$)/g I’m using mark.js to highlight this RegEx string. How can I…
Daniel
  • 25
  • 4
0
votes
1 answer

Does mark.js work in a Greasemonkey/Tampermonkey user script?

I have this in the Tampermonkey script header section: // @require https://raw.githubusercontent.com/julmot/mark.js/master/dist/mark.js My marking instance: for (var i=0; i
MKKirk
  • 49
  • 8
0
votes
1 answer

Non-greedy RegEx for mark.js

I have just started using mark.js (https://markjs.io), and right now I am trying to find the right RegEx to capture as little data as possible (non-greedy type), and no more than a certain number of characters. I tried multiple options, and so far I…
Alex
  • 85
  • 7
0
votes
1 answer

Mark.js highlight text wrapped in html tag

I am trying to highlight a phrase using Mark.js but part of the phrase is wrapped in an html tag. So Mark.js will not highlight the phrase. I am not sure how to resolve this. Any help will be appreciated.