Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add bookmark to nothing #16
Sometimes links show up just because a part of the word is identified as a bookmark. For example, function contains the word ion.
To fix this, allow for unbookmarking. If you unbookmark a word/phrase, every instance of that word/phrase will be free of bookmarks. For example, unbookmarking the word function should prevent any links from showing up in any instance of the word function.
Another thing to try is to add a bookmark tag to require whitespace before the phrase (or be the beginning of a line) and/or whitespace after the phrase. Or maybe search text by regex.
So if you set the bookmark to require whitespace before the word, 'ionization' would have ion highlighted, but 'function' won't.
Fixed this by allowing user to specify regex before a match and regex after a match. For the ion example, the following regex was used...
The regex that precedes a ion match must be totally empty or end with a non-word character (space, tab, period, dash, etc..)
The regex that follows a ion match must be totally empty or start with a non-word character that isn't S -- we still want to match ion in the word ions.