This repository has been archived by the owner on Jul 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- ignored balancing optional elements
- Loading branch information
adon
committed
Aug 17, 2015
1 parent
a3a15a5
commit da0c27c
Showing
4 changed files
with
56 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,12 +35,12 @@ Authors: Aditya Mahendrakar <[email protected]> | |
var html = "</div>foo</h2>bar<a href=\"123\">hello<b>world</a><embed>123</embed><br /><br/><p>"; | ||
|
||
// with tag balancing enabled by default | ||
var output = (new Purifier()).purify(html); | ||
assert.equal(output, 'foobar<a href=\"123\">hello<b>world</b></a><embed />123<br /><br /><p></p>'); | ||
var output = (new Purifier({enableTagBalancing:true})).purify(html); | ||
assert.equal(output, 'foobar<a href="123">hello<b>world</a><embed />123<br /><br /><p></b>'); | ||
|
||
// with tag balancing disabled | ||
var output = (new Purifier({enableTagBalancing:false})).purify(html); | ||
assert.equal(output, "</div>foo</h2>bar<a href=\"123\">hello<b>world</a><embed />123</embed><br /><br /><p>"); | ||
assert.equal(output, '</div>foo</h2>bar<a href="123">hello<b>world</a><embed />123</embed><br /><br /><p>'); | ||
}); | ||
|
||
it('should handle all vectors mentioned in https://html5sec.org', function(){ | ||
|