fix(security): no warning when sanitizing escaped html (#9392) (#9413)

This commit is contained in:
Wojciech Kwiatek
2016-06-23 22:06:19 +02:00
committed by Martin Probst
parent 6c5b653593
commit 98cef76931
2 changed files with 8 additions and 4 deletions

View File

@ -51,6 +51,10 @@ export function main() {
t.expect(sanitizeHtml('<?pi nodes?>no.')).toEqual('no.');
t.expect(logMsgs.join('\n')).toMatch(/sanitizing HTML stripped some content/);
});
t.it('supports sanitizing escaped entities', () => {
t.expect(sanitizeHtml('&#128640;')).toEqual('&#128640;');
t.expect(logMsgs).toEqual([]);
});
t.it('escapes entities', () => {
t.expect(sanitizeHtml('<p>Hello &lt; World</p>')).toEqual('<p>Hello &lt; World</p>');
t.expect(sanitizeHtml('<p>Hello < World</p>')).toEqual('<p>Hello &lt; World</p>');