add some tests

This commit is contained in:
syuilo 2023-02-04 09:28:34 +09:00
parent c7b6579e69
commit 48d2027c25

View file

@ -1028,6 +1028,14 @@ hoge`;
];
assert.deepStrictEqual(mfm.parse(input), output);
});
it('prevent xss', () => {
const input = 'javascript:foo';
const output = [
TEXT('javascript:foo')
];
assert.deepStrictEqual(mfm.parse(input), output);
});
});
describe('link', () => {
@ -1064,6 +1072,14 @@ hoge`;
assert.deepStrictEqual(mfm.parse(input), output);
});
it('prevent xss', () => {
const input = '[click here](javascript:foo)';
const output = [
TEXT('[click here](javascript:foo)')
];
assert.deepStrictEqual(mfm.parse(input), output);
});
describe('cannot nest a url in a link label', () => {
it('basic', () => {
const input = 'official instance: [https://misskey.io/@ai](https://misskey.io/@ai).';