@@ -66,6 +66,8 @@ public void linking() {
66
66
assertLinked ("http://example.org/" , "|http://example.org/|" );
67
67
assertLinked ("http://example.org/123" , "|http://example.org/123|" );
68
68
assertLinked ("http://example.org/?foo=test&bar=123" , "|http://example.org/?foo=test&bar=123|" );
69
+ assertLinked ("http://example.org/?foo=%20" , "|http://example.org/?foo=%20|" );
70
+ assertLinked ("http://example.org/%3C" , "|http://example.org/%3C|" );
69
71
}
70
72
71
73
@ Test
@@ -74,13 +76,29 @@ public void schemeSeparatedByNonAlphanumeric() {
74
76
}
75
77
76
78
@ Test
77
- public void spaceSeparation () {
79
+ public void spaceCharactersStopUrl () {
78
80
assertLinked ("foo http://example.org/" , "foo |http://example.org/|" );
79
81
assertLinked ("http://example.org/ bar" , "|http://example.org/| bar" );
82
+ assertLinked ("http://example.org/\t bar" , "|http://example.org/|\t bar" );
83
+ assertLinked ("http://example.org/\n bar" , "|http://example.org/|\n bar" );
84
+ assertLinked ("http://example.org/\u000B bar" , "|http://example.org/|\u000B bar" );
85
+ assertLinked ("http://example.org/\f bar" , "|http://example.org/|\f bar" );
86
+ assertLinked ("http://example.org/\r bar" , "|http://example.org/|\r bar" );
80
87
}
81
88
82
89
@ Test
83
- public void delimiterSeparation () {
90
+ public void illegalCharactersStopUrl () {
91
+ assertLinked ("http://example.org/<" , "|http://example.org/|<" );
92
+ assertLinked ("http://example.org/>" , "|http://example.org/|>" );
93
+ assertLinked ("http://example.org/<>" , "|http://example.org/|<>" );
94
+ assertLinked ("http://example.org/\u0000 " , "|http://example.org/|\u0000 " );
95
+ assertLinked ("http://example.org/\u000E " , "|http://example.org/|\u000E " );
96
+ assertLinked ("http://example.org/\u007F " , "|http://example.org/|\u007F " );
97
+ assertLinked ("http://example.org/\u009F " , "|http://example.org/|\u009F " );
98
+ }
99
+
100
+ @ Test
101
+ public void delimiterAtEnd () {
84
102
assertLinked ("http://example.org/." , "|http://example.org/|." );
85
103
assertLinked ("http://example.org/.." , "|http://example.org/|.." );
86
104
assertLinked ("http://example.org/," , "|http://example.org/|," );
@@ -95,7 +113,6 @@ public void matchingPunctuation() {
95
113
assertLinked ("http://example.org/a(b)" , "|http://example.org/a(b)|" );
96
114
assertLinked ("http://example.org/a[b]" , "|http://example.org/a[b]|" );
97
115
assertLinked ("http://example.org/a{b}" , "|http://example.org/a{b}|" );
98
- assertLinked ("http://example.org/a<b>" , "|http://example.org/a<b>|" );
99
116
assertLinked ("http://example.org/a\" b\" " , "|http://example.org/a\" b\" |" );
100
117
assertLinked ("http://example.org/a'b'" , "|http://example.org/a'b'|" );
101
118
assertLinked ("(http://example.org/)" , "(|http://example.org/|)" );
@@ -136,6 +153,8 @@ public void html() {
136
153
assertLinked ("http://example.org'>" , "|http://example.org|'>" );
137
154
assertLinked ("http://example.org\" />" , "|http://example.org|\" />" );
138
155
assertLinked ("http://example.org'/>" , "|http://example.org|'/>" );
156
+ assertLinked ("http://example.org<p>" , "|http://example.org|<p>" );
157
+ assertLinked ("http://example.org</p>" , "|http://example.org|</p>" );
139
158
}
140
159
141
160
@ Test
@@ -161,6 +180,8 @@ public void multiple() {
161
180
@ Test
162
181
public void international () {
163
182
assertLinked ("http://üñîçøðé.com/ä" , "|http://üñîçøðé.com/ä|" );
183
+ assertLinked ("http://example.org/\u00A1 " , "|http://example.org/\u00A1 |" );
184
+ assertLinked ("http://example.org/\u00A2 " , "|http://example.org/\u00A2 |" );
164
185
}
165
186
166
187
@ Test
0 commit comments