aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/completion.coffee
diff options
context:
space:
mode:
authormrmr19932013-09-15 07:08:58 +0100
committermrmr19932014-04-16 14:43:46 +0100
commitf454304f2750eb797b0e9683a87c1bdd354b1b17 (patch)
tree24ba8155f40bbac164f90403fd53b5a44fc1906c /background_scripts/completion.coffee
parent66a3ab3096e968342ceb9a52ba0f04094a6ea653 (diff)
downloadvimium-f454304f2750eb797b0e9683a87c1bdd354b1b17.tar.bz2
Highlight escaped HTML in Vomnibar results (fixes #914)
Diffstat (limited to 'background_scripts/completion.coffee')
-rw-r--r--background_scripts/completion.coffee4
1 files changed, 3 insertions, 1 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee
index 92e325e1..8b30dc43 100644
--- a/background_scripts/completion.coffee
+++ b/background_scripts/completion.coffee
@@ -71,7 +71,9 @@ class Suggestion
# Wraps each occurence of the query terms in the given string in a <span>.
highlightTerms: (string) ->
ranges = []
- for term in @queryTerms
+ # Escape the terms before highlighting
+ escapedTerms = @queryTerms.map (oldTerm) -> Utils.escapeHtml(oldTerm)
+ for term in escapedTerms
@pushMatchingRanges string, term, ranges
return string if ranges.length == 0