Skip to content

Commit c234395

Browse files
committed
GitHub Issue #62: html-encode input text when calculating width
1 parent 76e9024 commit c234395

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ var markFirstLastOptions = function() {
10531053
var calcTextWidth = function(text) {
10541054
// add the text to the dummy span with some extra characters as a buffer
10551055
// NOTE: "W" seems to be the widest character in most fonts
1056-
inputWidthProxyEl.html(text + 'WW');
1056+
inputWidthProxyEl.html(encode(text) + 'WW');
10571057

10581058
// copy text-related css properties from the input element to the proxy
10591059
var cssProps = {};

0 commit comments

Comments
 (0)