`label` field of suggestions is also HTML escaped

Without this if the suggestion text contains a double quote, the
response stops being a valid json.
This commit is contained in:
Veloman Yunkan 2021-03-03 00:49:07 +04:00 committed by Matthieu Gautier
parent a7fea462b0
commit c7d77395e7
2 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@
response: function( event, ui ) {
for(const item of ui.content) {
item.label = htmlDecode(item.label);
item.value = htmlDecode(item.value);
}
},

View File

@ -2,6 +2,6 @@
{{#suggestions}}{{^first}},{{/first}}
{
"value" : "{{value}}",
"label" : "{{& label}}"
"label" : "{{label}}"
}{{/suggestions}}
]