mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 01:07:14 +08:00
0c085059c9
added sane way to do $LAB includes - pattern to be expanded people keep on messing structure.sql
20 lines
435 B
JavaScript
20 lines
435 B
JavaScript
describe("sanitize", function(){
|
|
|
|
|
|
it("strips all script tags", function(){
|
|
sanitized = sanitizeHtml("<div><script>alert('hi');</script></div>");
|
|
|
|
expect(sanitized)
|
|
.toBe("<div></div>");
|
|
});
|
|
|
|
it("strips disallowed attributes", function(){
|
|
sanitized = sanitizeHtml("<div><p class=\"funky\" wrong='1'>hello</p></div>");
|
|
|
|
expect(sanitized)
|
|
.toBe("<div><p class=\"funky\">hello</p></div>");
|
|
});
|
|
});
|
|
|
|
|