mirror of
https://github.com/status-im/codimd.git
synced 2025-02-28 11:10:32 +00:00
fix: strip html tags for gist file, gist line, gist highlight line, gist show loading attrtributes
Signed-off-by: Max Wu <jackymaxj@gmail.com>
This commit is contained in:
parent
6966881152
commit
2eefe7706f
@ -334,6 +334,14 @@ export function finishView (view) {
|
|||||||
// strip HTML tags to avoid stored XSS
|
// strip HTML tags to avoid stored XSS
|
||||||
const gistid = value.getAttribute('data-gist-id')
|
const gistid = value.getAttribute('data-gist-id')
|
||||||
value.setAttribute('data-gist-id', stripTags(gistid))
|
value.setAttribute('data-gist-id', stripTags(gistid))
|
||||||
|
const gistfile = value.getAttribute('data-gist-file')
|
||||||
|
if (gistfile) value.setAttribute('data-gist-file', stripTags(gistfile))
|
||||||
|
const gistline = value.getAttribute('data-gist-line')
|
||||||
|
if (gistline) value.setAttribute('data-gist-line', stripTags(gistline))
|
||||||
|
const gisthighlightline = value.getAttribute('data-gist-highlight-line')
|
||||||
|
if (gisthighlightline) value.setAttribute('data-gist-highlight-line', stripTags(gisthighlightline))
|
||||||
|
const gistshowloading = value.getAttribute('data-gist-show-loading')
|
||||||
|
if (gistshowloading) value.setAttribute('data-gist-show-loading', stripTags(gistshowloading))
|
||||||
$(value).gist(window.viewAjaxCallback)
|
$(value).gist(window.viewAjaxCallback)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user