mark.js

Mark js, Anchor tag issue

为君一笑 提交于 2020-06-17 15:48:10
问题 I've been using a chrome extension to select sentences on the page. I were recommended to used the library Mark.js to avoid destroying event listener and or element inside elements. var markInstance = new Mark(document.body); var options = { element: `mark`, className: `highlight-${position}`, exclude: ['.ignore'], separateWordSearch: false, debug: true, }; markInstance.mark(sentence, options); I've been having problems with sentences that contains hyperlinks Examples: Learn more about the