aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/link_hints.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'content_scripts/link_hints.coffee')
-rw-r--r--content_scripts/link_hints.coffee4
1 files changed, 3 insertions, 1 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 702ff69d..d7f6191e 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -501,7 +501,9 @@ class FilterHints
scoreLinkHint: (linkSearchString) ->
searchWords = linkSearchString.trim().toLowerCase().split @splitRegexp
(linkMarker) =>
- linkWords = linkMarker.linkWords ?= linkMarker.linkText.toLowerCase().split @splitRegexp
+ # We only keep non-empty link words. Empty link words cannot be matched, and leading empty link words
+ # disrupt the scoring of matches at the start of the text.
+ linkWords = linkMarker.linkWords ?= linkMarker.linkText.toLowerCase().split(@splitRegexp).filter (term) -> term
searchWordScores =
for searchWord in searchWords