mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 18:51:08 +08:00
Convert all CoffeeScript to Javascript. See:
http://meta.discourse.org/t/is-it-better-for-discourse-to-use-javascript-or-coffeescript/3153
This commit is contained in:
@ -1,15 +1,17 @@
|
||||
/*global waitsFor:true expect:true describe:true beforeEach:true it:true sanitizeHtml:true */
|
||||
|
||||
describe("sanitize", function(){
|
||||
|
||||
|
||||
it("strips all script tags", function(){
|
||||
sanitized = sanitizeHtml("<div><script>alert('hi');</script></div>");
|
||||
var 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>");
|
||||
var sanitized = sanitizeHtml("<div><p class=\"funky\" wrong='1'>hello</p></div>");
|
||||
|
||||
expect(sanitized)
|
||||
.toBe("<div><p class=\"funky\">hello</p></div>");
|
||||
|
Reference in New Issue
Block a user