Skip to content

Commit 3e93ae9

Browse files
committed
Escape render option and item
1 parent 04f40fd commit 3e93ae9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Autocomplete/assets/dist/controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ _default_1_instances = new WeakSet(), _default_1_getCommonConfig = function _def
344344
optgroupField: 'group_by',
345345
score: (search) => (item) => 1,
346346
render: {
347-
option: (item) => `<div>${item[labelField]}</div>`,
348-
item: (item) => `<div>${item[labelField]}</div>`,
347+
option: (item, escapeData) => `<div>${escapeData(item[labelField])}</div>`,
348+
item: (item, escapeData) => `<div>${escapeData(item[labelField])}</div>`,
349349
loading_more: () => {
350350
return `<div class="loading-more-results">${this.loadingMoreTextValue}</div>`;
351351
},

src/Autocomplete/assets/src/controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ export default class extends Controller {
296296
// avoid extra filtering after results are returned
297297
score: (search: string) => (item: any) => 1,
298298
render: {
299-
option: (item: any) => `<div>${item[labelField]}</div>`,
300-
item: (item: any) => `<div>${item[labelField]}</div>`,
299+
option: (item: any, escapeData: typeof escape_html) => `<div>${escapeData(item[labelField])}</div>`,
300+
item: (item: any, escapeData: typeof escape_html) => `<div>${escapeData(item[labelField])}</div>`,
301301
loading_more: (): string => {
302302
return `<div class="loading-more-results">${this.loadingMoreTextValue}</div>`;
303303
},

0 commit comments

Comments
 (0)