mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 03:25:31 -05:00
f661fa609e
http://meta.discourse.org/t/is-it-better-for-discourse-to-use-javascript-or-coffeescript/3153
21 lines
538 B
JavaScript
21 lines
538 B
JavaScript
/*global waitsFor:true expect:true describe:true beforeEach:true it:true sanitizeHtml:true */
|
|
|
|
describe("sanitize", function(){
|
|
|
|
|
|
it("strips all script tags", function(){
|
|
var sanitized = sanitizeHtml("<div><script>alert('hi');</script></div>");
|
|
|
|
expect(sanitized)
|
|
.toBe("<div></div>");
|
|
});
|
|
|
|
it("strips disallowed attributes", function(){
|
|
var sanitized = sanitizeHtml("<div><p class=\"funky\" wrong='1'>hello</p></div>");
|
|
|
|
expect(sanitized)
|
|
.toBe("<div><p class=\"funky\">hello</p></div>");
|
|
});
|
|
});
|
|
|
|
|