Skip to content

Commit

Permalink
label field of suggestions is also HTML escaped
Browse files Browse the repository at this point in the history
Without this if the suggestion text contains a double quote, the
response stops being a valid json.
  • Loading branch information
veloman-yunkan committed Mar 2, 2021
1 parent 7f0710d commit 408f3aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions static/templates/head_part.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

response: function( event, ui ) {
for(const item of ui.content) {
item.label = htmlDecode(item.label);
item.value = htmlDecode(item.value);
}
},
Expand Down
2 changes: 1 addition & 1 deletion static/templates/suggestion.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{{#suggestions}}{{^first}},{{/first}}
{
"value" : "{{value}}",
"label" : "{{& label}}"
"label" : "{{label}}"
}{{/suggestions}}
]

0 comments on commit 408f3aa

Please sign in to comment.