mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-21 21:55:09 +00:00
add some tests
This commit is contained in:
parent
c7b6579e69
commit
48d2027c25
1 changed files with 16 additions and 0 deletions
|
@ -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).';
|
||||
|
|
Loading…
Reference in a new issue