Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bookmark to nothing #16

Closed
offbynull opened this issue Jul 7, 2019 · 2 comments

Comments

Projects
None yet
1 participant
@offbynull
Copy link
Owner

commented Jul 7, 2019

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.

@offbynull

This comment has been minimized.

Copy link
Owner Author

commented Jul 7, 2019

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.

@offbynull

This comment has been minimized.

Copy link
Owner Author

commented Jul 8, 2019

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... {bm} ion:true:^$|^.[\W]$:^[\WsS].$|^$

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.

@offbynull offbynull closed this Jul 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.