You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Desktop: Security: Fixes #6004: Prevent XSS in Goto Anything
This commit is contained in:
32
packages/renderer/htmlUtils.test.ts
Normal file
32
packages/renderer/htmlUtils.test.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import htmlUtils from './htmlUtils';
|
||||
|
||||
describe('htmlUtils', () => {
|
||||
|
||||
test('should strip off HTML', () => {
|
||||
const testCases = [
|
||||
[
|
||||
'',
|
||||
'',
|
||||
],
|
||||
[
|
||||
'<b>test</b>',
|
||||
'test',
|
||||
],
|
||||
[
|
||||
'Joplin®',
|
||||
'Joplin®',
|
||||
],
|
||||
[
|
||||
'<b>test</b>',
|
||||
'<b>test</b>',
|
||||
],
|
||||
];
|
||||
|
||||
for (const t of testCases) {
|
||||
const [input, expected] = t;
|
||||
const actual = htmlUtils.stripHtml(input);
|
||||
expect(actual).toBe(expected);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user