File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1580,4 +1580,17 @@ describe('sanitizeHtml', function() {
1580
1580
assert . equal ( sanitizeHtml ( '<a href target="_blank">hello</a>' , {
1581
1581
} ) , '<a target="_blank">hello</a>' ) ;
1582
1582
} ) ;
1583
+ it ( 'should not remove non-boolean attributes that are empty when disabled' , function ( ) {
1584
+ assert . equal ( sanitizeHtml ( '<a href target="_blank">hello</a>' , {
1585
+ nonBooleanAttributes : [ ]
1586
+ } ) , '<a href target="_blank">hello</a>' ) ;
1587
+ } ) ;
1588
+ it ( 'should not remove boolean attributes that are empty' , function ( ) {
1589
+ assert . equal ( sanitizeHtml ( '<input checked form type="checkbox" />' , {
1590
+ allowedTags : 'input' ,
1591
+ allowedAttributes : {
1592
+ input : [ 'checked' , 'form' , 'type' ]
1593
+ }
1594
+ } ) , '<input checked type="checkbox" />' ) ;
1595
+ } ) ;
1583
1596
} ) ;
You can’t perform that action at this time.
0 commit comments