Hacker News new | ask | show | jobs
by bowlingx 4030 days ago
That's correct. But it is possible to specify a context container where the highlighting is executed so if you change parts of the document (like around this container) it doesn't change the relative path.

Example:

<html>

<body>

<article id="myContextContainer">

  <p>...</p>
</article>

</body>

</html>

If you add or change words and paragraphs of course, that would make the highlighting unstable. You could also restrict the marking to a specific paragraph only (and set the context accordingly). It always depends on the application this library is used for. But if anyone has a good idea how to compensate that I'm open for suggestions :)

Thank you for your feedback.