Removed the jQuery Highlight plugin and created a new es6 highlighting library.
This pull request has been mentioned on Discourse Meta. There might be relevant details there:
Can we use
Node.ELEMENT_NODE and other enums rather than hard coding integers here? It’s much more clear.
Let’s remove this constant too.
if (!words.length) return node;
highlight-html lib should be tested
@vinothkannans are we just waiting on a few tests here prior to merging? Agree it makes sense to test this, especially since it is so easy to test.
Yes, I’ll make it today
I did some improvements and added a test here @ZogStriP. The highlight function is performing well in big paragraphs and the large number of posts @SamSaffron. Anyway, we’re going keep using
\b regex if Unicode words are not found.