File: 0002-Fix-test-script-regexp-syntax-for-Perl-5.22.patch

package info (click to toggle)
libhtml-defang-perl 1.04-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 600 kB
  • ctags: 41
  • sloc: perl: 4,242; makefile: 7
file content (918 lines) | stat: -rw-r--r-- 41,367 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
From d61140731d698d62258a7c8bb6b649cb7a4a7ea6 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sun, 27 Dec 2015 18:46:17 +0200
Subject: [PATCH 2/2] Fix test script regexp syntax for Perl 5.22

Perl 5.22 introduced the warning

 Unescaped left brace in regex is deprecated, passed through in regex

which triggers in these regexps.

Bug: https://rt.cpan.org/Public/Bug/Display.html?id=110663
---
 t/01_basic.t     |   4 +-
 t/02_xss.t       | Bin 45684 -> 45691 bytes
 t/03_styles.t    | 136 ++++++++---------
 t/04_imports.t   |   2 +-
 t/05_callbacks.t | 442 +++++++++++++++++++++++++++----------------------------
 t/06_unicode.t   |   2 +-
 6 files changed, 293 insertions(+), 293 deletions(-)

diff --git a/t/01_basic.t b/t/01_basic.t
index 91a91f0..b1efcc3 100755
--- a/t/01_basic.t
+++ b/t/01_basic.t
@@ -456,8 +456,8 @@ $H = <<EOF;
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{<!--$CommentStartText\[if gte mso 10\]> <mce:style><!    /\* Style Definitions \*/  table.MsoNormalTable	{mso-fareast-font-family:"Times New Roman";}  $CommentEndText--> <!--$CommentStartText\[endif\]$CommentEndText--></p>
-<p>&nbsp;<span style="font-size: medium;">I need your help now!</span></p>}, "IE conditional comment without appropriate closing tag");
+like($Res, qr[<!--$CommentStartText\[if gte mso 10\]> <mce:style><!    /\* Style Definitions \*/  table.MsoNormalTable	\{mso-fareast-font-family:"Times New Roman";}  $CommentEndText--> <!--$CommentStartText\[endif\]$CommentEndText--></p>
+<p>&nbsp;<span style="font-size: medium;">I need your help now!</span></p>], "IE conditional comment without appropriate closing tag");
 
 $H = <<'EOF';
 1:<br>
diff --git a/t/02_xss.t b/t/02_xss.t
index 794340c..b4adbff 100644
Binary files a/t/02_xss.t and b/t/02_xss.t differ
diff --git a/t/03_styles.t b/t/03_styles.t
index 5bf83d5..352286e 100644
--- a/t/03_styles.t
+++ b/t/03_styles.t
@@ -40,9 +40,9 @@ p {font-family: "sans serif"}
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
-p {font-family: "sans serif"}
-$CommentEndText--></style>$}s, "Style tag property with quotes and space");
+like($Res, qr[^<style><!--${CommentStartText}
+p \{font-family: "sans serif"}
+$CommentEndText--></style>$]s, "Style tag property with quotes and space");
 
 $H = <<EOF;
 <style>
@@ -51,10 +51,10 @@ p {text-align:center;color:red}
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
-p {text-align:center;color:red}
+like($Res, qr[^<style><!--${CommentStartText}
+p \{text-align:center;color:red}
 $CommentEndText--></style>
-$}s, "Multiple properties");
+$]s, "Multiple properties");
 
 $H = <<EOF;
 <style>
@@ -68,15 +68,15 @@ font-family: arial
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
+like($Res, qr[^<style><!--${CommentStartText}
 p
-{
+\{
 text-align: center;
 color: black;
 font-family: arial
 }
 $CommentEndText--></style>
-$}s, "Multiple properties in readable format");
+$]s, "Multiple properties in readable format");
 
 $H = <<EOF;
 <style>
@@ -88,13 +88,13 @@ color: green
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
+like($Res, qr[^<style><!--${CommentStartText}
 h1,h2,h3,h4,h5,h6 
-{
+\{
 color: green
 }
 $CommentEndText--></style>
-$}s, "Multiple selectors");
+$]s, "Multiple selectors");
 
 $H = <<EOF;
 <style>
@@ -104,11 +104,11 @@ p.center {text-align: center}
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
-p.right {text-align: right}
-p.center {text-align: center}
+like($Res, qr[^<style><!--${CommentStartText}
+p.right \{text-align: right}
+p.center \{text-align: center}
 $CommentEndText--></style>
-$}s, "Selector with a period");
+$]s, "Selector with a period");
 
 $H = <<EOF;
 <style>
@@ -117,10 +117,10 @@ $H = <<EOF;
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
-.center {text-align: center}
+like($Res, qr[^<style><!--${CommentStartText}
+.center \{text-align: center}
 $CommentEndText--></style>
-$}, "Selector starting in a period");
+$], "Selector starting in a period");
 
 $H = <<EOF;
 <style>
@@ -129,10 +129,10 @@ input[type="text"] {background-color: blue}
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
-input\[type="text"\] {background-color: blue}
+like($Res, qr[^<style><!--${CommentStartText}
+input\[type="text"\] \{background-color: blue}
 $CommentEndText--></style>
-$}s, "Selector with square brackets");
+$]s, "Selector with square brackets");
 
 $H = <<EOF;
 <style>
@@ -141,10 +141,10 @@ $H = <<EOF;
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
-#green {color: green}
+like($Res, qr[^<style><!--${CommentStartText}
+#green \{color: green}
 $CommentEndText--></style>
-$}s, "Selector starting with a hash");
+$]s, "Selector starting with a hash");
 
 $H = <<EOF;
 <style>
@@ -157,14 +157,14 @@ color: red
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
+like($Res, qr[^<style><!--${CommentStartText}
 p#para1
-{
+\{
 text-align: center;
 color: red
 }
 $CommentEndText--></style>
-$}s, "Selector with a hash");
+$]s, "Selector with a hash");
 
 $H = <<EOF;
 <style>
@@ -183,17 +183,17 @@ comment here
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
+like($Res, qr[^<style><!--${CommentStartText}
 
 p
-{
+\{
 text-align: center;
 
 color: black;
 font-family: arial 
 }
 $CommentEndText--></style>
-$}s, "All sorts of comments");
+$]s, "All sorts of comments");
 
 $H = <<EOF;
 <style>
@@ -249,14 +249,14 @@ $H = <<EOF;
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<STYLE><!--${CommentStartText}BODY{/\*-moz-binding:url\("http://ha.ckers.org/xssmoz.xml#xss"\)\*/}$CommentEndText--></STYLE>$}s, "Remote style sheet part 4");
+like($Res, qr[^<STYLE><!--${CommentStartText}BODY\{/\*-moz-binding:url\("http://ha.ckers.org/xssmoz.xml#xss"\)\*/}$CommentEndText--></STYLE>$]s, "Remote style sheet part 4");
 
 $H = <<EOF;
 <STYLE>li {list-style-image: url("javascript:alert('XSS')");}</STYLE><UL><LI>XSS
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<STYLE><!--${CommentStartText}li {/\*list-style-image: url\("javascript:alert\('XSS'\)"\);\*/}$CommentEndText--></STYLE><UL><LI>XSS$}s, "List-style-image");
+like($Res, qr[^<STYLE><!--${CommentStartText}li \{/\*list-style-image: url\("javascript:alert\('XSS'\)"\);\*/}$CommentEndText--></STYLE><UL><LI>XSS$]s, "List-style-image");
 
 $H = <<'EOF';
 <STYLE>@im\port'\ja\vasc\ript:alert("XSS")';</STYLE>
@@ -276,9 +276,9 @@ $H = <<EOF;
 a{sss:sss}</STYLE>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^<STYLE><!--${CommentStartText}
+like($Res, qr[^<STYLE><!--${CommentStartText}
 
-a{sss:sss}$CommentEndText--></STYLE>$}s, "Removing multiple css imports");
+a\{sss:sss}$CommentEndText--></STYLE>$]s, "Removing multiple css imports");
 
 $H = <<EOF;
 <STYLE>\@import'javascript:alert("XSS")';
@@ -291,14 +291,14 @@ a{sss:11111111}</STYLE>
 a{sss:22222222}</STYLE>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^<STYLE><!--${CommentStartText}
+like($Res, qr[^<STYLE><!--${CommentStartText}
 
-a{sss:11111111}$CommentEndText--></STYLE>
+a\{sss:11111111}$CommentEndText--></STYLE>
 <!--defang_someunknowntag-->
 <br>
 <STYLE><!--${CommentStartText}
 
-a{sss:22222222}$CommentEndText--></STYLE>$}s, "Removing multiple css imports with multiple styles");
+a\{sss:22222222}$CommentEndText--></STYLE>$]s, "Removing multiple css imports with multiple styles");
 
 $H = <<EOF;
 <STYLE>
@@ -308,11 +308,11 @@ p {property: value}
 </STYLE>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^<STYLE>
+like($Res, qr[^<STYLE>
 <!--${CommentStartText}
-p {property: value}
+p \{property: value}
 $CommentEndText-->
-</STYLE>$}s, "Removing HTML comments");
+</STYLE>$]s, "Removing HTML comments");
 
 
 # Tests taken from http://imfo.ru/csstest/css_hacks/import.php
@@ -471,7 +471,7 @@ $H = <<EOF;
 <style>em{color:red};\@import url(&#34;style.css&#34;);</style>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^<style><!--${CommentStartText}em{color:red}$CommentEndText--></style>$}, "Test 26");
+like($Res, qr[^<style><!--${CommentStartText}em\{color:red}$CommentEndText--></style>$], "Test 26");
 
 $H = <<EOF;
 <style>\@import url(&#34;style.css&#34;);</style>
@@ -597,14 +597,14 @@ like($Res, qr{25:<a style="s5\{aa:ab\}s6\{ac:ad\}">}s, "Test style attribute - m
 like($Res, qr{26:<a style=" s7  \{   ae    :     af      \}       s8        \{         ag          :           ah            \}             ">}s, "Test style attribute - multiple property pairs with selectors, braces and spaces but without semi-colon");
 like($Res, qr{27:<a style="s5\{ai:aj;\}s6\{ak:al;\}">}s, "Test style attribute - multiple property pairs with selectors, braces and semi-colon but without spaces");
 like($Res, qr{28:<a style=" s7  \{   am    :     an      \}       s8        \{         ao          :           ap            ;             \}              ">}s, "Test style attribute - multiple property pairs with selectors, braces spaces and semi-colon");
-like($Res, qr{29:<a style="{color: #900} :link {background: #ff0} :visited {background: #fff} :hover {outline: thin red solid} :active {background: #00f}">}s, "Test style attribute - style rule with and without selectors");
-like($Res, qr{30:<a style="{color: #090; line-height: 1.2} ::first-letter {color: #900}">}, "Test style attribute - style rule with and without selectors in single line");
-like($Res, qr{31:<a href="abccomscript" title="a" id="a1" style="{color: #900}
-          :link {background: #ff0}
-          :visited {background: #fff}
-          :hover {outline: thin red solid}
-          :active {background: #00f}">
-$}, "Test style attribute - style rule with and without selectors over multiple lines");
+like($Res, qr[29:<a style="\{color: #900} :link \{background: #ff0} :visited \{background: #fff} :hover \{outline: thin red solid} :active \{background: #00f}">]s, "Test style attribute - style rule with and without selectors");
+like($Res, qr[30:<a style="\{color: #090; line-height: 1.2} ::first-letter \{color: #900}">], "Test style attribute - style rule with and without selectors in single line");
+like($Res, qr[31:<a href="abccomscript" title="a" id="a1" style="\{color: #900}
+          :link \{background: #ff0}
+          :visited \{background: #fff}
+          :hover \{outline: thin red solid}
+          :active \{background: #00f}">
+$], "Test style attribute - style rule with and without selectors over multiple lines");
 
 $H = <<EOF;
 <style>   
@@ -623,19 +623,19 @@ selector5{ab:cd;x:y;p:q;r:url(http://a.com);e:url("http://b.com") ;}
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{<style><!--${CommentStartText}   
+like($Res, qr[<style><!--${CommentStartText}   
 
-selector1{ab:cd}
-selector2{ab:cd;}
-selector3{ab:cd;ef:gh}
-selector4{ab:cd;ef:gh;}
-selector5{ab:cd;x:y;p:q;/\*r:url\(http://a.com\);\*//\*e:url\("http://b.com"\) ;\*/}
- selector6  {   ab    :     cd      }       
- selector7  {   ab    :     cd      ;       }        
- selector8  {   ab    :     cd      ;       ef        :         gh          }           
- selector9  {   ab    :     cd      ;       ef        :         gh          ;           }            
- selector10  {   ab    :     cd      ;       x         :         y           ;           /\*r            :             url\(http://a.com\)              \*/}               
-    $CommentEndText--></style>}s, "Test style tag css with and without spaces");
+selector1\{ab:cd}
+selector2\{ab:cd;}
+selector3\{ab:cd;ef:gh}
+selector4\{ab:cd;ef:gh;}
+selector5\{ab:cd;x:y;p:q;/\*r:url\(http://a.com\);\*//\*e:url\("http://b.com"\) ;\*/}
+ selector6  \{   ab    :     cd      }       
+ selector7  \{   ab    :     cd      ;       }        
+ selector8  \{   ab    :     cd      ;       ef        :         gh          }           
+ selector9  \{   ab    :     cd      ;       ef        :         gh          ;           }            
+ selector10  \{   ab    :     cd      ;       x         :         y           ;           /\*r            :             url\(http://a.com\)              \*/}               
+    $CommentEndText--></style>]s, "Test style tag css with and without spaces");
 
 $H = <<EOF;
 <style>
@@ -649,14 +649,14 @@ body {color: black}
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style>
+like($Res, qr[^<style>
 
 <!--${CommentStartText}
 
-body {color: black}
+body \{color: black}
 
 $CommentEndText-->  
-</style>$}s, "Style tag with HTML comments");
+</style>$]s, "Style tag with HTML comments");
 
 $H = <<EOF;
 <style>
@@ -665,7 +665,7 @@ body {color: black}
 EOF
 $Res = $Defang->defang($H);
 
-like($Res, qr{^<style><!--${CommentStartText}
-body {color: black}
-$CommentEndText--></style>$}s, "Style tag without HTML comments");
+like($Res, qr[^<style><!--${CommentStartText}
+body \{color: black}
+$CommentEndText--></style>$]s, "Style tag without HTML comments");
 
diff --git a/t/04_imports.t b/t/04_imports.t
index 144b09b..01c07bf 100644
--- a/t/04_imports.t
+++ b/t/04_imports.t
@@ -167,7 +167,7 @@ $H = <<EOF;
 <style>em{color:red};\@import url(&#34;style.css&#34;);</style>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^<style><!--${CommentStartText}em{color:red}${CommentEndText}--></style>$}, "Test 26");
+like($Res, qr[^<style><!--${CommentStartText}em\{color:red}${CommentEndText}--></style>$], "Test 26");
 
 $H = <<EOF;
 <style>\@import url(&#34;style.css&#34;);</style>
diff --git a/t/05_callbacks.t b/t/05_callbacks.t
index 59d23a8..d955331 100644
--- a/t/05_callbacks.t
+++ b/t/05_callbacks.t
@@ -522,7 +522,7 @@ selector5{ab:cd;x:y;p:q;r:url(http://a.com);e:url("http://b.com") ;}
     </style>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^1:<a style="a:b">
+like($Res, qr[^1:<a style="a:b">
 2:<a style=" c  :   d    ">
 3:<a style="e:f;">
 4:<a style=" g  :   h    ;     ">
@@ -532,51 +532,51 @@ like($Res, qr{^1:<a style="a:b">
 7:<a style="i3:j3;k3:l3;">
 8:<a style=" i4  :   j4    ;     k4      :       l4        ;         ">
 
-9:<a style="{q:r}">
-10:<a style=" {  s   :    t     }      ">
-11:<a style="{u:v;}">
-12:<a style=" {  w   :    x     ;      }       ">
-
-13:<a style="{i5:j5;k5:l5}">
-14:<a style=" {  i6   :    j6     ;      k6       :        l6         }          ">
-15:<a style="{i7:j7;k7:l7;}">
-16:<a style=" {  i8   :    j8     ;      k8       :        l8         ;          }          ">
-
-17:<a style="s1{y:z}">
-18:<a style=" s1  {   y2    :     z2      }       ">
-19:<a style="s1{y3:z3;}">
-20:<a style=" s1  {   y4    :     z4      ;       }        ">
-
-21:<a style="s1{y5:z5;y6:z6}">
-22:<a style=" s2  {   y7    :     z7      ;       y8        :         z8          }           ">
-23:<a style="s3{y9:z9;y10:z11;}">
-24:<a style=" s4  {   y12    :     z12      ;       y13        :         z13          ;           }            ">
-
-25:<a style="s5{aa:ab}s6{ac:ad}">
-26:<a style=" s7  {   ae    :     af      }       s8        {         ag          :           ah            }             ">
-27:<a style="s5{ai:aj;}s6{ak:al;}">
-28:<a style=" s7  {   am    :     an      }       s8        {         ao          :           ap            ;             }              ">
-
-29:<a style="{color: #900} :link {background: #ff0} :visited {background: #fff} :hover {outline: thin red solid} :active {background: #00f}">
-30:<a style="{color: #090; line-height: 1.2} ::first-letter {color: #900}">
-31:<a href="abccomscript" title="a" id="a1" style="{color: #900}
-          :link {background: #ff0}
-          :visited {background: #fff}
-          :hover {outline: thin red solid}
-          :active {background: #00f}">
+9:<a style="\{q:r}">
+10:<a style=" \{  s   :    t     }      ">
+11:<a style="\{u:v;}">
+12:<a style=" \{  w   :    x     ;      }       ">
+
+13:<a style="\{i5:j5;k5:l5}">
+14:<a style=" \{  i6   :    j6     ;      k6       :        l6         }          ">
+15:<a style="\{i7:j7;k7:l7;}">
+16:<a style=" \{  i8   :    j8     ;      k8       :        l8         ;          }          ">
+
+17:<a style="s1\{y:z}">
+18:<a style=" s1  \{   y2    :     z2      }       ">
+19:<a style="s1\{y3:z3;}">
+20:<a style=" s1  \{   y4    :     z4      ;       }        ">
+
+21:<a style="s1\{y5:z5;y6:z6}">
+22:<a style=" s2  \{   y7    :     z7      ;       y8        :         z8          }           ">
+23:<a style="s3\{y9:z9;y10:z11;}">
+24:<a style=" s4  \{   y12    :     z12      ;       y13        :         z13          ;           }            ">
+
+25:<a style="s5\{aa:ab}s6\{ac:ad}">
+26:<a style=" s7  \{   ae    :     af      }       s8        \{         ag          :           ah            }             ">
+27:<a style="s5\{ai:aj;}s6\{ak:al;}">
+28:<a style=" s7  \{   am    :     an      }       s8        \{         ao          :           ap            ;             }              ">
+
+29:<a style="\{color: #900} :link \{background: #ff0} :visited \{background: #fff} :hover \{outline: thin red solid} :active \{background: #00f}">
+30:<a style="\{color: #090; line-height: 1.2} ::first-letter \{color: #900}">
+31:<a href="abccomscript" title="a" id="a1" style="\{color: #900}
+          :link \{background: #ff0}
+          :visited \{background: #fff}
+          :hover \{outline: thin red solid}
+          :active \{background: #00f}">
 <style><!--${CommentStartText}   
 
-selector1{ab:cd}
-selector2{ab:cccd;}
-selector3{ab:cd;ef:gh}
-selector4{ab:cd;ef:gh;}
-selector5{ab:cd;x:y;p:q;/\*r:url\(http://a.com\);\*//\*e:url\("http://b.com"\) ;\*/}
- selector6  {   ab    :     cd      }       
- selector7  {   ab    :     cd      ;       }        
- selector8  {   ab    :     cd      ;       ef        :         gh          }           
- selector9  {   ab    :     cd      ;       ef        :         gh          ;           }            
- selector10  {   ab    :     cd      ;       x         :         y           ;           /\*r            :             url\(http://a.com\)              \*/}               
-    ${CommentEndText}--></style>$}, "CSS callback - force normal");
+selector1\{ab:cd}
+selector2\{ab:cccd;}
+selector3\{ab:cd;ef:gh}
+selector4\{ab:cd;ef:gh;}
+selector5\{ab:cd;x:y;p:q;/\*r:url\(http://a.com\);\*//\*e:url\("http://b.com"\) ;\*/}
+ selector6  \{   ab    :     cd      }       
+ selector7  \{   ab    :     cd      ;       }        
+ selector8  \{   ab    :     cd      ;       ef        :         gh          }           
+ selector9  \{   ab    :     cd      ;       ef        :         gh          ;           }            
+ selector10  \{   ab    :     cd      ;       x         :         y           ;           /\*r            :             url\(http://a.com\)              \*/}               
+    ${CommentEndText}--></style>$], "CSS callback - force normal");
 
 $Defang = HTML::Defang->new(
   css_callback => sub {
@@ -649,7 +649,7 @@ selector5{ab:cd;x:y;p:q;r:url(http://a.com);e:url("http://b.com") ;}
     </style>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^1:<a style="a:b">
+like($Res, qr[^1:<a style="a:b">
 2:<a style=" c  :   d    ">
 3:<a style="e:f;">
 4:<a style=" g  :   h    ;     ">
@@ -659,51 +659,51 @@ like($Res, qr{^1:<a style="a:b">
 7:<a style="i3:j3;k3:l3;">
 8:<a style=" i4  :   j4    ;     k4      :       l4        ;         ">
 
-9:<a style="{q:r}">
-10:<a style=" {  s   :    t     }      ">
-11:<a style="{u:v;}">
-12:<a style=" {  w   :    x     ;      }       ">
-
-13:<a style="{i5:j5;k5:l5}">
-14:<a style=" {  i6   :    j6     ;      k6       :        l6         }          ">
-15:<a style="{i7:j7;k7:l7;}">
-16:<a style=" {  i8   :    j8     ;      k8       :        l8         ;          }          ">
-
-17:<a style="s1{y:z}">
-18:<a style=" s1  {   y2    :     z2      }       ">
-19:<a style="s1{y3:z3;}">
-20:<a style=" s1  {   y4    :     z4      ;       }        ">
-
-21:<a style="s1{y5:z5;y6:z6}">
-22:<a style=" s2  {   y7    :     z7      ;       y8        :         z8          }           ">
-23:<a style="s3{y9:z9;y10:z11;}">
-24:<a style=" s4  {   y12    :     z12      ;       y13        :         z13          ;           }            ">
-
-25:<a style="s5{aa:ab}s6{ac:ad}">
-26:<a style=" s7  {   ae    :     af      }       s8        {         ag          :           ah            }             ">
-27:<a style="s5{ai:aj;}s6{ak:al;}">
-28:<a style=" s7  {   am    :     an      }       s8        {         ao          :           ap            ;             }              ">
-
-29:<a style="{color: #900} :link {background: #ff0} :visited {background: #fff} :hover {outline: thin red solid} :active {background: #00f}">
-30:<a style="{color: #090; line-height: 1.2} ::first-letter {color: #900}">
-31:<a href="abccomscript" title="a" id="a1" style="{color: #900}
-          :link {background: #ff0}
-          :visited {background: #fff}
-          :hover {outline: thin red solid}
-          :active {background: #00f}">
+9:<a style="\{q:r}">
+10:<a style=" \{  s   :    t     }      ">
+11:<a style="\{u:v;}">
+12:<a style=" \{  w   :    x     ;      }       ">
+
+13:<a style="\{i5:j5;k5:l5}">
+14:<a style=" \{  i6   :    j6     ;      k6       :        l6         }          ">
+15:<a style="\{i7:j7;k7:l7;}">
+16:<a style=" \{  i8   :    j8     ;      k8       :        l8         ;          }          ">
+
+17:<a style="s1\{y:z}">
+18:<a style=" s1  \{   y2    :     z2      }       ">
+19:<a style="s1\{y3:z3;}">
+20:<a style=" s1  \{   y4    :     z4      ;       }        ">
+
+21:<a style="s1\{y5:z5;y6:z6}">
+22:<a style=" s2  \{   y7    :     z7      ;       y8        :         z8          }           ">
+23:<a style="s3\{y9:z9;y10:z11;}">
+24:<a style=" s4  \{   y12    :     z12      ;       y13        :         z13          ;           }            ">
+
+25:<a style="s5\{aa:ab}s6\{ac:ad}">
+26:<a style=" s7  \{   ae    :     af      }       s8        \{         ag          :           ah            }             ">
+27:<a style="s5\{ai:aj;}s6\{ak:al;}">
+28:<a style=" s7  \{   am    :     an      }       s8        \{         ao          :           ap            ;             }              ">
+
+29:<a style="\{color: #900} :link \{background: #ff0} :visited \{background: #fff} :hover \{outline: thin red solid} :active \{background: #00f}">
+30:<a style="\{color: #090; line-height: 1.2} ::first-letter \{color: #900}">
+31:<a href="abccomscript" title="a" id="a1" style="\{color: #900}
+          :link \{background: #ff0}
+          :visited \{background: #fff}
+          :hover \{outline: thin red solid}
+          :active \{background: #00f}">
 <style><!--${CommentStartText}   
 
-selector1{ab:cd}
-selector2{ab:cccd;}
-selector3{ab:cd;ef:gh}
-selector4{ab:cd;ef:gh;}
-selector5{ab:cd;x:y;p:q;r:url\(http://a.com\);e:url\("http://b.com"\) ;}
- selector6  {   ab    :     cd      }       
- selector7  {   ab    :     cd      ;       }        
- selector8  {   ab    :     cd      ;       ef        :         gh          }           
- selector9  {   ab    :     cd      ;       ef        :         gh          ;           }            
- selector10  {   ab    :     cd      ;       x         :         y           ;           r            :             url\(http://a.com\)              }               
-    ${CommentEndText}--></style>$}, "CSS callback - force skip");
+selector1\{ab:cd}
+selector2\{ab:cccd;}
+selector3\{ab:cd;ef:gh}
+selector4\{ab:cd;ef:gh;}
+selector5\{ab:cd;x:y;p:q;r:url\(http://a.com\);e:url\("http://b.com"\) ;}
+ selector6  \{   ab    :     cd      }       
+ selector7  \{   ab    :     cd      ;       }        
+ selector8  \{   ab    :     cd      ;       ef        :         gh          }           
+ selector9  \{   ab    :     cd      ;       ef        :         gh          ;           }            
+ selector10  \{   ab    :     cd      ;       x         :         y           ;           r            :             url\(http://a.com\)              }               
+    ${CommentEndText}--></style>$], "CSS callback - force skip");
 
 $Defang = HTML::Defang->new(
   css_callback => sub {
@@ -776,7 +776,7 @@ selector5{ab:cd;x:y;p:q;r:url(http://a.com);e:url("http://b.com") ;}
     </style>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^1:<a style="/\*a:b\*/">
+like($Res, qr[^1:<a style="/\*a:b\*/">
 2:<a style=" /\*c  :   d    \*/">
 3:<a style="/\*e:f;\*/">
 4:<a style=" /\*g  :   h    ;\*/     ">
@@ -786,51 +786,51 @@ like($Res, qr{^1:<a style="/\*a:b\*/">
 7:<a style="/\*i3:j3;\*//\*k3:l3;\*/">
 8:<a style=" /\*i4  :   j4    ;\*/     /\*k4      :       l4        ;\*/         ">
 
-9:<a style="{/\*q:r\*/}">
-10:<a style=" {  /\*s   :    t     \*/}      ">
-11:<a style="{/\*u:v;\*/}">
-12:<a style=" {  /\*w   :    x     ;\*/      }       ">
-
-13:<a style="{/\*i5:j5;\*//\*k5:l5\*/}">
-14:<a style=" {  /\*i6   :    j6     ;\*/      /\*k6       :        l6         \*/}          ">
-15:<a style="{/\*i7:j7;\*//\*k7:l7;\*/}">
-16:<a style=" {  /\*i8   :    j8     ;\*/      /\*k8       :        l8         ;\*/          }          ">
-
-17:<a style="s1{/\*y:z\*/}">
-18:<a style=" s1  {   /\*y2    :     z2      \*/}       ">
-19:<a style="s1{/\*y3:z3;\*/}">
-20:<a style=" s1  {   /\*y4    :     z4      ;\*/       }        ">
-
-21:<a style="s1{/\*y5:z5;\*//\*y6:z6\*/}">
-22:<a style=" s2  {   /\*y7    :     z7      ;\*/       /\*y8        :         z8          \*/}           ">
-23:<a style="s3{/\*y9:z9;\*//\*y10:z11;\*/}">
-24:<a style=" s4  {   /\*y12    :     z12      ;\*/       /\*y13        :         z13          ;\*/           }            ">
-
-25:<a style="s5{/\*aa:ab\*/}s6{/\*ac:ad\*/}">
-26:<a style=" s7  {   /\*ae    :     af      \*/}       s8        {         /\*ag          :           ah            \*/}             ">
-27:<a style="s5{/\*ai:aj;\*/}s6{/\*ak:al;\*/}">
-28:<a style=" s7  {   /\*am    :     an      \*/}       s8        {         /\*ao          :           ap            ;\*/             }              ">
-
-29:<a style="{/\*color: #900\*/} :link {/\*background: #ff0\*/} :visited {/\*background: #fff\*/} :hover {/\*outline: thin red solid\*/} :active {/\*background: #00f\*/}">
-30:<a style="{/\*color: #090;\*/ /\*line-height: 1.2\*/} ::first-letter {/\*color: #900\*/}">
-31:<a href="abccomscript" title="a" id="a1" style="{/\*color: #900\*/}
-          :link {/\*background: #ff0\*/}
-          :visited {/\*background: #fff\*/}
-          :hover {/\*outline: thin red solid\*/}
-          :active {/\*background: #00f\*/}">
+9:<a style="\{/\*q:r\*/}">
+10:<a style=" \{  /\*s   :    t     \*/}      ">
+11:<a style="\{/\*u:v;\*/}">
+12:<a style=" \{  /\*w   :    x     ;\*/      }       ">
+
+13:<a style="\{/\*i5:j5;\*//\*k5:l5\*/}">
+14:<a style=" \{  /\*i6   :    j6     ;\*/      /\*k6       :        l6         \*/}          ">
+15:<a style="\{/\*i7:j7;\*//\*k7:l7;\*/}">
+16:<a style=" \{  /\*i8   :    j8     ;\*/      /\*k8       :        l8         ;\*/          }          ">
+
+17:<a style="s1\{/\*y:z\*/}">
+18:<a style=" s1  \{   /\*y2    :     z2      \*/}       ">
+19:<a style="s1\{/\*y3:z3;\*/}">
+20:<a style=" s1  \{   /\*y4    :     z4      ;\*/       }        ">
+
+21:<a style="s1\{/\*y5:z5;\*//\*y6:z6\*/}">
+22:<a style=" s2  \{   /\*y7    :     z7      ;\*/       /\*y8        :         z8          \*/}           ">
+23:<a style="s3\{/\*y9:z9;\*//\*y10:z11;\*/}">
+24:<a style=" s4  \{   /\*y12    :     z12      ;\*/       /\*y13        :         z13          ;\*/           }            ">
+
+25:<a style="s5\{/\*aa:ab\*/}s6\{/\*ac:ad\*/}">
+26:<a style=" s7  \{   /\*ae    :     af      \*/}       s8        \{         /\*ag          :           ah            \*/}             ">
+27:<a style="s5\{/\*ai:aj;\*/}s6\{/\*ak:al;\*/}">
+28:<a style=" s7  \{   /\*am    :     an      \*/}       s8        \{         /\*ao          :           ap            ;\*/             }              ">
+
+29:<a style="\{/\*color: #900\*/} :link \{/\*background: #ff0\*/} :visited \{/\*background: #fff\*/} :hover \{/\*outline: thin red solid\*/} :active \{/\*background: #00f\*/}">
+30:<a style="\{/\*color: #090;\*/ /\*line-height: 1.2\*/} ::first-letter \{/\*color: #900\*/}">
+31:<a href="abccomscript" title="a" id="a1" style="\{/\*color: #900\*/}
+          :link \{/\*background: #ff0\*/}
+          :visited \{/\*background: #fff\*/}
+          :hover \{/\*outline: thin red solid\*/}
+          :active \{/\*background: #00f\*/}">
 <style><!--${CommentStartText}   
 
-selector1{/\*ab:cd\*/}
-selector2{/\*ab:cccd;\*/}
-selector3{/\*ab:cd;\*//\*ef:gh\*/}
-selector4{/\*ab:cd;\*//\*ef:gh;\*/}
-selector5{/\*ab:cd;\*//\*x:y;\*//\*p:q;\*//\*r:url\(http://a.com\);\*//\*e:url\("http://b.com"\) ;\*/}
- selector6  {   /\*ab    :     cd      \*/}       
- selector7  {   /\*ab    :     cd      ;\*/       }        
- selector8  {   /\*ab    :     cd      ;\*/       /\*ef        :         gh          \*/}           
- selector9  {   /\*ab    :     cd      ;\*/       /\*ef        :         gh          ;\*/           }            
- selector10  {   /\*ab    :     cd      ;\*/       /\*x         :         y           ;\*/           /\*r            :             url\(http://a.com\)              \*/}               
-    ${CommentEndText}--></style>}, "CSS callback - force defang");
+selector1\{/\*ab:cd\*/}
+selector2\{/\*ab:cccd;\*/}
+selector3\{/\*ab:cd;\*//\*ef:gh\*/}
+selector4\{/\*ab:cd;\*//\*ef:gh;\*/}
+selector5\{/\*ab:cd;\*//\*x:y;\*//\*p:q;\*//\*r:url\(http://a.com\);\*//\*e:url\("http://b.com"\) ;\*/}
+ selector6  \{   /\*ab    :     cd      \*/}       
+ selector7  \{   /\*ab    :     cd      ;\*/       }        
+ selector8  \{   /\*ab    :     cd      ;\*/       /\*ef        :         gh          \*/}           
+ selector9  \{   /\*ab    :     cd      ;\*/       /\*ef        :         gh          ;\*/           }            
+ selector10  \{   /\*ab    :     cd      ;\*/       /\*x         :         y           ;\*/           /\*r            :             url\(http://a.com\)              \*/}               
+    ${CommentEndText}--></style>], "CSS callback - force defang");
 
 $Defang = HTML::Defang->new(
   css_callback => sub {
@@ -901,7 +901,7 @@ selector5{ab:cd;x:y;p:q;r:url(http://a.com);e:url("http://b.com") ;}
     </style>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^1:<a style="a:b;orange:juice">
+like($Res, qr[^1:<a style="a:b;orange:juice">
 2:<a style=" c  :   d    ;orange:juice">
 3:<a style="e:f;orange:juice">
 4:<a style=" g  :   h    ;     orange:juice">
@@ -911,51 +911,51 @@ like($Res, qr{^1:<a style="a:b;orange:juice">
 7:<a style="i3:j3;k3:l3;orange:juice">
 8:<a style=" i4  :   j4    ;     k4      :       l4        ;         orange:juice">
 
-9:<a style="{q:r;orange:juice}">
-10:<a style=" {  s   :    t     ;orange:juice}      ">
-11:<a style="{u:v;orange:juice}">
-12:<a style=" {  w   :    x     ;      orange:juice}       ">
-
-13:<a style="{i5:j5;k5:l5;orange:juice}">
-14:<a style=" {  i6   :    j6     ;      k6       :        l6         ;orange:juice}          ">
-15:<a style="{i7:j7;k7:l7;orange:juice}">
-16:<a style=" {  i8   :    j8     ;      k8       :        l8         ;          orange:juice}          ">
-
-17:<a style="s1{y:z;orange:juice}">
-18:<a style=" s1  {   y2    :     z2      ;orange:juice}       ">
-19:<a style="s1{y3:z3;orange:juice}">
-20:<a style=" s1  {   y4    :     z4      ;       orange:juice}        ">
-
-21:<a style="s1{y5:z5;y6:z6;orange:juice}">
-22:<a style=" s2  {   y7    :     z7      ;       y8        :         z8          ;orange:juice}           ">
-23:<a style="s3{y9:z9;y10:z11;orange:juice}">
-24:<a style=" s4  {   y12    :     z12      ;       y13        :         z13          ;           orange:juice}            ">
-
-25:<a style="s5{aa:ab;orange:juice}s6{ac:ad;orange:juice}">
-26:<a style=" s7  {   ae    :     af      ;orange:juice}       s8        {         ag          :           ah            ;orange:juice}             ">
-27:<a style="s5{ai:aj;orange:juice}s6{ak:al;orange:juice}">
-28:<a style=" s7  {   am    :     an      ;orange:juice}       s8        {         ao          :           ap            ;             orange:juice}              ">
-
-29:<a style="{color: #900;orange:juice} :link {background: #ff0;orange:juice} :visited {background: #fff;orange:juice} :hover {outline: thin red solid;orange:juice} :active {background: #00f;orange:juice}">
-30:<a style="{color: #090; line-height: 1.2;orange:juice} ::first-letter {color: #900;orange:juice}">
-31:<a href="abccomscript" title="a" id="a1" style="{color: #900;orange:juice}
-          :link {background: #ff0;orange:juice}
-          :visited {background: #fff;orange:juice}
-          :hover {outline: thin red solid;orange:juice}
-          :active {background: #00f;orange:juice}">
+9:<a style="\{q:r;orange:juice}">
+10:<a style=" \{  s   :    t     ;orange:juice}      ">
+11:<a style="\{u:v;orange:juice}">
+12:<a style=" \{  w   :    x     ;      orange:juice}       ">
+
+13:<a style="\{i5:j5;k5:l5;orange:juice}">
+14:<a style=" \{  i6   :    j6     ;      k6       :        l6         ;orange:juice}          ">
+15:<a style="\{i7:j7;k7:l7;orange:juice}">
+16:<a style=" \{  i8   :    j8     ;      k8       :        l8         ;          orange:juice}          ">
+
+17:<a style="s1\{y:z;orange:juice}">
+18:<a style=" s1  \{   y2    :     z2      ;orange:juice}       ">
+19:<a style="s1\{y3:z3;orange:juice}">
+20:<a style=" s1  \{   y4    :     z4      ;       orange:juice}        ">
+
+21:<a style="s1\{y5:z5;y6:z6;orange:juice}">
+22:<a style=" s2  \{   y7    :     z7      ;       y8        :         z8          ;orange:juice}           ">
+23:<a style="s3\{y9:z9;y10:z11;orange:juice}">
+24:<a style=" s4  \{   y12    :     z12      ;       y13        :         z13          ;           orange:juice}            ">
+
+25:<a style="s5\{aa:ab;orange:juice}s6\{ac:ad;orange:juice}">
+26:<a style=" s7  \{   ae    :     af      ;orange:juice}       s8        \{         ag          :           ah            ;orange:juice}             ">
+27:<a style="s5\{ai:aj;orange:juice}s6\{ak:al;orange:juice}">
+28:<a style=" s7  \{   am    :     an      ;orange:juice}       s8        \{         ao          :           ap            ;             orange:juice}              ">
+
+29:<a style="\{color: #900;orange:juice} :link \{background: #ff0;orange:juice} :visited \{background: #fff;orange:juice} :hover \{outline: thin red solid;orange:juice} :active \{background: #00f;orange:juice}">
+30:<a style="\{color: #090; line-height: 1.2;orange:juice} ::first-letter \{color: #900;orange:juice}">
+31:<a href="abccomscript" title="a" id="a1" style="\{color: #900;orange:juice}
+          :link \{background: #ff0;orange:juice}
+          :visited \{background: #fff;orange:juice}
+          :hover \{outline: thin red solid;orange:juice}
+          :active \{background: #00f;orange:juice}">
 <style><!--${CommentStartText}   
 
-selector1{ab:cd;orange:juice}
-selector2{ab:cccd;orange:juice}
-selector3{ab:cd;ef:gh;orange:juice}
-selector4{ab:cd;ef:gh;orange:juice}
-selector5{ab:cd;x:y;p:q;/\*r:url\(http://a.com\);\*//\*e:url\("http://b.com"\) ;\*/orange:juice}
- selector6  {   ab    :     cd      ;orange:juice}       
- selector7  {   ab    :     cd      ;       orange:juice}        
- selector8  {   ab    :     cd      ;       ef        :         gh          ;orange:juice}           
- selector9  {   ab    :     cd      ;       ef        :         gh          ;           orange:juice}            
- selector10  {   ab    :     cd      ;       x         :         y           ;           /\*r            :             url\(http://a.com\)              ;\*/orange:juice}               
-    ${CommentEndText}--></style>$}, "CSS callback - insert attribute");
+selector1\{ab:cd;orange:juice}
+selector2\{ab:cccd;orange:juice}
+selector3\{ab:cd;ef:gh;orange:juice}
+selector4\{ab:cd;ef:gh;orange:juice}
+selector5\{ab:cd;x:y;p:q;/\*r:url\(http://a.com\);\*//\*e:url\("http://b.com"\) ;\*/orange:juice}
+ selector6  \{   ab    :     cd      ;orange:juice}       
+ selector7  \{   ab    :     cd      ;       orange:juice}        
+ selector8  \{   ab    :     cd      ;       ef        :         gh          ;orange:juice}           
+ selector9  \{   ab    :     cd      ;       ef        :         gh          ;           orange:juice}            
+ selector10  \{   ab    :     cd      ;       x         :         y           ;           /\*r            :             url\(http://a.com\)              ;\*/orange:juice}               
+    ${CommentEndText}--></style>$], "CSS callback - insert attribute");
 
 
 $Defang = HTML::Defang->new(
@@ -1027,7 +1027,7 @@ selector5{ab:cd;x:y;p:q;r:url(http://a.com);e:url("http://b.com") ;}
     </style>
 EOF
 $Res = $Defang->defang($H);
-like($Res, qr{^1:<a style="">
+like($Res, qr[^1:<a style="">
 2:<a style=" ">
 3:<a style="">
 4:<a style=" ">
@@ -1037,51 +1037,51 @@ like($Res, qr{^1:<a style="">
 7:<a style="i3:j3;">
 8:<a style=" i4  :   j4    ;     ">
 
-9:<a style="{}">
-10:<a style=" {}      ">
-11:<a style="{}">
-12:<a style=" {}       ">
-
-13:<a style="{i5:j5;}">
-14:<a style=" {  i6   :    j6     ;      }          ">
-15:<a style="{i7:j7;}">
-16:<a style=" {  i8   :    j8     ;      }          ">
-
-17:<a style="s1{}">
-18:<a style=" s1  {}       ">
-19:<a style="s1{}">
-20:<a style=" s1  {}        ">
-
-21:<a style="s1{y5:z5;}">
-22:<a style=" s2  {   y7    :     z7      ;       }           ">
-23:<a style="s3{y9:z9;}">
-24:<a style=" s4  {   y12    :     z12      ;       }            ">
-
-25:<a style="s5{}s6{}">
-26:<a style=" s7  {}       s8        {}             ">
-27:<a style="s5{}s6{}">
-28:<a style=" s7  {}       s8        {}              ">
-
-29:<a style="{} :link {} :visited {} :hover {} :active {}">
-30:<a style="{color: #090; } ::first-letter {}">
-31:<a href="abccomscript" title="a" id="a1" style="{}
-          :link {}
-          :visited {}
-          :hover {}
-          :active {}">
+9:<a style="\{}">
+10:<a style=" \{}      ">
+11:<a style="\{}">
+12:<a style=" \{}       ">
+
+13:<a style="\{i5:j5;}">
+14:<a style=" \{  i6   :    j6     ;      }          ">
+15:<a style="\{i7:j7;}">
+16:<a style=" \{  i8   :    j8     ;      }          ">
+
+17:<a style="s1\{}">
+18:<a style=" s1  \{}       ">
+19:<a style="s1\{}">
+20:<a style=" s1  \{}        ">
+
+21:<a style="s1\{y5:z5;}">
+22:<a style=" s2  \{   y7    :     z7      ;       }           ">
+23:<a style="s3\{y9:z9;}">
+24:<a style=" s4  \{   y12    :     z12      ;       }            ">
+
+25:<a style="s5\{}s6\{}">
+26:<a style=" s7  \{}       s8        \{}             ">
+27:<a style="s5\{}s6\{}">
+28:<a style=" s7  \{}       s8        \{}              ">
+
+29:<a style="\{} :link \{} :visited \{} :hover \{} :active \{}">
+30:<a style="\{color: #090; } ::first-letter \{}">
+31:<a href="abccomscript" title="a" id="a1" style="\{}
+          :link \{}
+          :visited \{}
+          :hover \{}
+          :active \{}">
 <style><!--${CommentStartText}   
 
-selector1{}
-selector2{}
-selector3{ab:cd;}
-selector4{ab:cd;}
-selector5{ab:cd;x:y;p:q;/\*r:url\(http://a.com\);\*/}
- selector6  {}       
- selector7  {}        
- selector8  {   ab    :     cd      ;       }           
- selector9  {   ab    :     cd      ;       }            
- selector10  {   ab    :     cd      ;       x         :         y           ;           }               
-    ${CommentEndText}--></style>$}, "CSS callback - remove attribute from style rule end");
+selector1\{}
+selector2\{}
+selector3\{ab:cd;}
+selector4\{ab:cd;}
+selector5\{ab:cd;x:y;p:q;/\*r:url\(http://a.com\);\*/}
+ selector6  \{}       
+ selector7  \{}        
+ selector8  \{   ab    :     cd      ;       }           
+ selector9  \{   ab    :     cd      ;       }            
+ selector10  \{   ab    :     cd      ;       x         :         y           ;           }               
+    ${CommentEndText}--></style>$], "CSS callback - remove attribute from style rule end");
 
 $Defang = HTML::Defang->new(
   css_callback => sub {
@@ -1102,7 +1102,7 @@ EOF
 $Res = $Defang->defang($H);
 like($Res, qr{1:<a STYLE="a:b;orange:juice">}, "Style callback attribute in upper case");
 like($Res, qr{2:<a STYLE="A:b;orange:juice">}, "Style callback attribute and style property in upper case");
-like($Res, qr{3:<STYLE><!--${CommentStartText}A {WIDTH: 30;orange:juice}${CommentEndText}--></STYLE>}, "Style callback tag and style property in upper case");
+like($Res, qr[3:<STYLE><!--${CommentStartText}A \{WIDTH: 30;orange:juice}${CommentEndText}--></STYLE>], "Style callback tag and style property in upper case");
 
 #################################
 #  Multiple callback test
diff --git a/t/06_unicode.t b/t/06_unicode.t
index d0a783e..e699ebb 100644
--- a/t/06_unicode.t
+++ b/t/06_unicode.t
@@ -51,5 +51,5 @@ $Res = $Defang->defang($H);
 ok(Encode::is_utf8($Res), "output2 is unicode");
 like($Res, qr{^<!--defang_p-->岡<!--/defang_p-->}, "defang2 preserves unicode");
 like($Res, qr{^<!--defang_a defang_href="http://blah\.com/ø" defang_class="û"-->non-english href<!--/defang_a-->}m, "defang2 preserves unicode2");
-like($Res, qr(^<style><!--a { /\*color:redû;\*/ }--></style>)m, "style unicode correct");
+like($Res, qr(^<style><!--a \{ /\*color:redû;\*/ }--></style>)m, "style unicode correct");
 
-- 
2.6.4