mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-10 15:50:59 +00:00
Don't store mermaid diagrams in innerHTML
Using jQuery's `.html()` method stores the given string as `innerHTML`, which enables injection of arbitrary DOM elements. Using `.text()` instead mitigates this issue. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
89ecff4b1c
commit
c32b1cf42b
1 changed files with 1 additions and 1 deletions
|
@ -386,7 +386,7 @@ export function finishView (view) {
|
|||
|
||||
window.mermaid.mermaidAPI.parse($value.text())
|
||||
$ele.addClass('mermaid')
|
||||
$ele.html($value.text())
|
||||
$ele.text($value.text())
|
||||
window.mermaid.init(undefined, $ele)
|
||||
} catch (err) {
|
||||
var errormessage = err
|
||||
|
|
Loading…
Reference in a new issue