@@ -10,38 +10,60 @@ def markdown(str)
1010# list of pairs consisting of input and a regex that must match the output.
1111pathological = {
1212 "nested strong emph" =>
13- [ "#{ "*a **a " * 65_000 } b#{ " a** a*" * 65_000 } " ,
14- Regexp . compile ( "(<em>a <strong>a ){65_000}b( a</strong> a</em>){65_000}" ) , ] ,
13+ [
14+ "#{ "*a **a " * 65_000 } b#{ " a** a*" * 65_000 } " ,
15+ Regexp . compile ( "(<em>a <strong>a ){65_000}b( a</strong> a</em>){65_000}" ) ,
16+ ] ,
1517 "many emph closers with no openers" =>
16- [ ( "a_ " * 65_000 ) ,
17- Regexp . compile ( "(a[_] ){64999}a_" ) , ] ,
18+ [
19+ ( "a_ " * 65_000 ) ,
20+ Regexp . compile ( "(a[_] ){64999}a_" ) ,
21+ ] ,
1822 "many emph openers with no closers" =>
19- [ ( "_a " * 65_000 ) ,
20- Regexp . compile ( "(_a ){64999}_a" ) , ] ,
23+ [
24+ ( "_a " * 65_000 ) ,
25+ Regexp . compile ( "(_a ){64999}_a" ) ,
26+ ] ,
2127 "many link closers with no openers" =>
22- [ ( "a]" * 65_000 ) ,
23- Regexp . compile ( '(a\]){65_000}' ) , ] ,
28+ [
29+ ( "a]" * 65_000 ) ,
30+ Regexp . compile ( '(a\]){65_000}' ) ,
31+ ] ,
2432 "many link openers with no closers" =>
25- [ ( "[a" * 65_000 ) ,
26- Regexp . compile ( '(\[a){65_000}' ) , ] ,
33+ [
34+ ( "[a" * 65_000 ) ,
35+ Regexp . compile ( '(\[a){65_000}' ) ,
36+ ] ,
2737 "mismatched openers and closers" =>
28- [ ( "*a_ " * 50_000 ) ,
29- Regexp . compile ( "([*]a[_] ){49999}[*]a_" ) , ] ,
38+ [
39+ ( "*a_ " * 50_000 ) ,
40+ Regexp . compile ( "([*]a[_] ){49999}[*]a_" ) ,
41+ ] ,
3042 "link openers and emph closers" =>
31- [ ( "[ a_" * 50_000 ) ,
32- Regexp . compile ( '(\[ a_){50000}' ) , ] ,
43+ [
44+ ( "[ a_" * 50_000 ) ,
45+ Regexp . compile ( '(\[ a_){50000}' ) ,
46+ ] ,
3347 "hard link/emph case" =>
34- [ "**x [a*b**c*](d)" ,
35- Regexp . compile ( '\\*\\*x <a href=\'d\'>a<em>b</em><em>c</em></a>' ) , ] ,
48+ [
49+ "**x [a*b**c*](d)" ,
50+ Regexp . compile ( '\\*\\*x <a href=\'d\'>a<em>b</em><em>c</em></a>' ) ,
51+ ] ,
3652 "nested brackets" =>
37- [ "#{ "[" * 50_000 } a#{ "]" * 50_000 } " ,
38- Regexp . compile ( '\[{50000}a\]{50000}' ) , ] ,
53+ [
54+ "#{ "[" * 50_000 } a#{ "]" * 50_000 } " ,
55+ Regexp . compile ( '\[{50000}a\]{50000}' ) ,
56+ ] ,
3957 "nested block quotes" =>
40- [ "#{ "> " * 50_000 } a" ,
41- Regexp . compile ( '(<blockquote>\n){50000}' ) , ] ,
58+ [
59+ "#{ "> " * 50_000 } a" ,
60+ Regexp . compile ( '(<blockquote>\n){50000}' ) ,
61+ ] ,
4262 "U+0000 in input" =>
43- [ 'abc\u0000de\u0000' ,
44- Regexp . compile ( 'abc\ufffd?de\ufffd?' ) , ] ,
63+ [
64+ 'abc\u0000de\u0000' ,
65+ Regexp . compile ( 'abc\ufffd?de\ufffd?' ) ,
66+ ] ,
4567}
4668
4769pathological . each_pair do |name , description |
0 commit comments