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 various fees you may incur here.

来源:https://stackoverflow.com/questions/62328518/mark-js-anchor-tag-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!