mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 00:01:34 +00:00
escape html for content search
This commit is contained in:
@@ -64,6 +64,16 @@
|
||||
function getCounts(n: number) {
|
||||
return ` (${n})`
|
||||
}
|
||||
|
||||
function escape(htmlStr) {
|
||||
return htmlStr
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
}
|
||||
|
||||
$: counts =
|
||||
search == '' ||
|
||||
!scripts ||
|
||||
@@ -126,7 +136,7 @@
|
||||
filter={search}
|
||||
items={apps}
|
||||
f={(s) => {
|
||||
return YAML.stringify(s.value, null, 4)
|
||||
return escape(YAML.stringify(s.value, null, 4))
|
||||
}}
|
||||
bind:filteredItems={filteredAppItems}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user