@@ -4,9 +4,9 @@ var test = require('tape')
4
4
var h = require ( 'hastscript' )
5
5
var findAndReplace = require ( '.' )
6
6
7
- test ( 'findAndReplace' , function ( t ) {
7
+ test ( 'findAndReplace' , function ( t ) {
8
8
t . throws (
9
- function ( ) {
9
+ function ( ) {
10
10
findAndReplace ( create ( ) , true )
11
11
} ,
12
12
/ ^ E r r o r : E x p e c t e d a r r a y o r o b j e c t a s s c h e m a $ / ,
@@ -42,7 +42,7 @@ test('findAndReplace', function(t) {
42
42
)
43
43
44
44
t . deepEqual (
45
- findAndReplace ( create ( ) , / e m ( \w + ) i s / , function ( $0 , $1 ) {
45
+ findAndReplace ( create ( ) , / e m ( \w + ) i s / , function ( $0 , $1 ) {
46
46
return '[' + $1 + ']'
47
47
} ) ,
48
48
h ( 'p' , [
@@ -58,7 +58,7 @@ test('findAndReplace', function(t) {
58
58
)
59
59
60
60
t . deepEqual (
61
- findAndReplace ( create ( ) , 'emphasis' , function ( ) {
61
+ findAndReplace ( create ( ) , 'emphasis' , function ( ) {
62
62
return h ( 'a' , h ( 'b' , 'c' ) )
63
63
} ) ,
64
64
h ( 'p' , [
@@ -122,7 +122,7 @@ test('findAndReplace', function(t) {
122
122
123
123
t . deepEqual (
124
124
findAndReplace ( create ( ) , {
125
- emphasis : function ( ) {
125
+ emphasis : function ( ) {
126
126
return h ( 'a' , 'importance' )
127
127
} ,
128
128
importance : 'something else'
@@ -168,13 +168,13 @@ test('findAndReplace', function(t) {
168
168
169
169
t . deepEqual (
170
170
findAndReplace ( h ( 'p' , 'Some emphasis, importance, and code.' ) , {
171
- importance : function ( match ) {
171
+ importance : function ( match ) {
172
172
return h ( 'strong' , match )
173
173
} ,
174
- code : function ( match ) {
174
+ code : function ( match ) {
175
175
return h ( 'code' , match )
176
176
} ,
177
- emphasis : function ( match ) {
177
+ emphasis : function ( match ) {
178
178
return h ( 'em' , match )
179
179
}
180
180
} ) ,
@@ -186,19 +186,19 @@ test('findAndReplace', function(t) {
186
186
findAndReplace ( h ( 'p' , 'Some emphasis, importance, and code.' ) , [
187
187
[
188
188
/ i m p o r t a n c e / g,
189
- function ( match ) {
189
+ function ( match ) {
190
190
return h ( 'strong' , match )
191
191
}
192
192
] ,
193
193
[
194
194
/ c o d e / g,
195
- function ( match ) {
195
+ function ( match ) {
196
196
return h ( 'code' , match )
197
197
}
198
198
] ,
199
199
[
200
200
/ e m p h a s i s / g,
201
- function ( match ) {
201
+ function ( match ) {
202
202
return h ( 'em' , match )
203
203
}
204
204
]
@@ -224,7 +224,7 @@ test('findAndReplace', function(t) {
224
224
)
225
225
226
226
t . deepEqual (
227
- findAndReplace ( create ( ) , 'and' , function ( ) {
227
+ findAndReplace ( create ( ) , 'and' , function ( ) {
228
228
return h ( 'script' , 'alert(1)' )
229
229
} ) ,
230
230
h ( 'p' , [
0 commit comments