@@ -10,38 +10,60 @@ def markdown(str)
10
10
# list of pairs consisting of input and a regex that must match the output.
11
11
pathological = {
12
12
"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
+ ] ,
15
17
"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
+ ] ,
18
22
"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
+ ] ,
21
27
"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
+ ] ,
24
32
"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
+ ] ,
27
37
"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
+ ] ,
30
42
"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
+ ] ,
33
47
"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
+ ] ,
36
52
"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
+ ] ,
39
57
"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
+ ] ,
42
62
"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
+ ] ,
45
67
}
46
68
47
69
pathological . each_pair do |name , description |
0 commit comments