@@ -11,8 +11,8 @@ var sanitize = require('.')
11
11
12
12
/* eslint-disable no-script-url, max-params */
13
13
14
- test ( 'sanitize()' , function ( t ) {
15
- t . test ( 'non-node' , function ( st ) {
14
+ test ( 'sanitize()' , function ( t ) {
15
+ t . test ( 'non-node' , function ( st ) {
16
16
st . equal ( html ( sanitize ( true ) ) , '' , 'should ignore non-nodes (#1)' )
17
17
st . equal ( html ( sanitize ( null ) ) , '' , 'should ignore non-nodes (#2)' )
18
18
st . equal ( html ( sanitize ( 1 ) ) , '' , 'should ignore non-nodes (#3)' )
@@ -21,7 +21,7 @@ test('sanitize()', function(t) {
21
21
st . end ( )
22
22
} )
23
23
24
- t . test ( 'unknown nodes' , function ( st ) {
24
+ t . test ( 'unknown nodes' , function ( st ) {
25
25
st . equal (
26
26
html ( sanitize ( u ( 'unknown' , '<xml></xml>' ) ) ) ,
27
27
'' ,
@@ -31,7 +31,7 @@ test('sanitize()', function(t) {
31
31
st . end ( )
32
32
} )
33
33
34
- t . test ( 'ignored nodes' , function ( st ) {
34
+ t . test ( 'ignored nodes' , function ( st ) {
35
35
st . equal ( html ( sanitize ( u ( 'raw' , '<xml></xml>' ) ) ) , '' , 'should ignore `raw`' )
36
36
37
37
st . equal (
@@ -55,7 +55,7 @@ test('sanitize()', function(t) {
55
55
st . end ( )
56
56
} )
57
57
58
- t . test ( '`comment`' , function ( st ) {
58
+ t . test ( '`comment`' , function ( st ) {
59
59
st . equal (
60
60
html ( sanitize ( u ( 'comment' , 'alpha' ) ) ) ,
61
61
'' ,
@@ -87,7 +87,7 @@ test('sanitize()', function(t) {
87
87
st . end ( )
88
88
} )
89
89
90
- t . test ( '`doctype`' , function ( st ) {
90
+ t . test ( '`doctype`' , function ( st ) {
91
91
st . equal (
92
92
html ( sanitize ( u ( 'doctype' , { name : 'html' } , 'alpha' ) ) ) ,
93
93
'' ,
@@ -105,7 +105,7 @@ test('sanitize()', function(t) {
105
105
st . end ( )
106
106
} )
107
107
108
- t . test ( '`text`' , function ( st ) {
108
+ t . test ( '`text`' , function ( st ) {
109
109
st . deepEqual (
110
110
sanitize ( {
111
111
type : 'text' ,
@@ -159,7 +159,7 @@ test('sanitize()', function(t) {
159
159
st . end ( )
160
160
} )
161
161
162
- t . test ( '`element`' , function ( st ) {
162
+ t . test ( '`element`' , function ( st ) {
163
163
st . deepEqual (
164
164
sanitize ( {
165
165
type : 'element' ,
@@ -346,7 +346,7 @@ test('sanitize()', function(t) {
346
346
'should ignore `svg` elements'
347
347
)
348
348
349
- st . test ( 'href`' , function ( sst ) {
349
+ st . test ( 'href`' , function ( sst ) {
350
350
testAllURLs ( sst , 'a' , 'href' , {
351
351
valid : {
352
352
anchor : '#heading' ,
@@ -372,7 +372,7 @@ test('sanitize()', function(t) {
372
372
sst . end ( )
373
373
} )
374
374
375
- st . test ( '`cite`' , function ( sst ) {
375
+ st . test ( '`cite`' , function ( sst ) {
376
376
testAllURLs ( sst , 'blockquote' , 'cite' , {
377
377
valid : {
378
378
anchor : '#heading' ,
@@ -397,7 +397,7 @@ test('sanitize()', function(t) {
397
397
sst . end ( )
398
398
} )
399
399
400
- st . test ( '`src`' , function ( sst ) {
400
+ st . test ( '`src`' , function ( sst ) {
401
401
testAllURLs ( sst , 'img' , 'src' , {
402
402
valid : {
403
403
anchor : '#heading' ,
@@ -422,7 +422,7 @@ test('sanitize()', function(t) {
422
422
sst . end ( )
423
423
} )
424
424
425
- st . test ( '`longDesc`' , function ( sst ) {
425
+ st . test ( '`longDesc`' , function ( sst ) {
426
426
testAllURLs ( sst , 'img' , 'longDesc' , {
427
427
valid : {
428
428
anchor : '#heading' ,
@@ -447,7 +447,7 @@ test('sanitize()', function(t) {
447
447
sst . end ( )
448
448
} )
449
449
450
- st . test ( '`li`' , function ( sst ) {
450
+ st . test ( '`li`' , function ( sst ) {
451
451
sst . deepEqual (
452
452
sanitize ( h ( 'li' , 'alert(1)' ) ) ,
453
453
u ( 'text' , 'alert(1)' ) ,
@@ -480,8 +480,8 @@ test('sanitize()', function(t) {
480
480
481
481
sst . end ( )
482
482
} )
483
- ; [ 'tr' , 'td' , 'th' , 'tbody' , 'thead' , 'tfoot' ] . forEach ( function ( name ) {
484
- st . test ( '`' + name + '`' , function ( sst ) {
483
+ ; [ 'tr' , 'td' , 'th' , 'tbody' , 'thead' , 'tfoot' ] . forEach ( function ( name ) {
484
+ st . test ( '`' + name + '`' , function ( sst ) {
485
485
sst . deepEqual (
486
486
sanitize ( h ( name , 'alert(1)' ) ) ,
487
487
u ( 'text' , 'alert(1)' ) ,
@@ -611,7 +611,7 @@ test('sanitize()', function(t) {
611
611
st . end ( )
612
612
} )
613
613
614
- t . test ( '`root`' , function ( st ) {
614
+ t . test ( '`root`' , function ( st ) {
615
615
st . deepEqual (
616
616
sanitize ( {
617
617
type : 'root' ,
@@ -660,7 +660,7 @@ function testAllURLs(t, tagName, prop, all) {
660
660
661
661
// Test `valid` `url`s in `prop` on `tagName`.
662
662
function testURLs ( t , tagName , prop , urls , valid ) {
663
- Object . keys ( urls ) . forEach ( function ( name ) {
663
+ Object . keys ( urls ) . forEach ( function ( name ) {
664
664
var props = { }
665
665
666
666
props [ prop ] = urls [ name ]
0 commit comments