We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83a044b commit d038b94Copy full SHA for d038b94
test/test.js
@@ -38,6 +38,21 @@ describe('paste-markdown', function () {
38
assert.include(textarea.value, 'name | origin\n-- | --\nhubot | github\nbender | futurama')
39
})
40
41
+ it("doesn't execute JavaScript", async function () {
42
+ let alertCalled = false
43
+ window.secretFunction = function () {
44
+ alertCalled = true
45
+ }
46
+ const data = {
47
+ 'text/html': `XSS<img/src/onerror=secretFunction()><table>`
48
49
+ paste(textarea, data)
50
+
51
+ await wait(100)
52
53
+ assert.isFalse(alertCalled, 'A XSS was possible as alert was called')
54
+ })
55
56
it('retains text around tables', async function () {
57
const data = {
58
'text/html': `
0 commit comments