You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"<a href=\"tel:1234567890\">A local phone number</a>"
236
+
+ "<a href=\"tel:1-234-567\">A number with dashes</a>"
237
+
+ "<a href=\"tel:1.234.567\">A number with dots</a>"
238
+
+ "<a href=\"tel:023 456 78 90\">Spaces need not be escaped but can</a>"
239
+
+ "<a href=\"tel:(555)1234\">Brackets need not be escaped but can</a>"
240
+
+ "<a href=\"tel:+1234567890\">The leading plus is a separator and MUST NOT be escaped</a>"
241
+
+ "<a href=\"tel:tel:890;phone-context=+123-4-567\">The equals is a separator and MUST NOT be escaped but the plus in the parameter is not a separator and MUST be escaped</a>"
242
+
);
243
+
Stringwant = (
244
+
"<a href=\"tel:1234567890\">A local phone number</a>"
245
+
+ "<a href=\"tel:1-234-567\">A number with dashes</a>"
246
+
+ "<a href=\"tel:1.234.567\">A number with dots</a>"
247
+
+ "<a href=\"tel:023%20456%2078%2090\">Spaces need not be escaped but can</a>"
248
+
+ "<a href=\"tel:%28555%291234\">Brackets need not be escaped but can</a>"
249
+
// fails, see https://datatracker.ietf.org/doc/html/rfc3966#section-3
250
+
+ "<a href=\"tel:+1234567890\">The leading plus is a separator and MUST NOT be escaped</a>"
251
+
// fails, see https://datatracker.ietf.org/doc/html/rfc3966#section-3
252
+
+ "<a href=\"tel:tel:890;phone-context=;+123-4-567\">The equals is a separator and MUST NOT be escaped but the plus in the parameter is not a separator and MUST be escaped</a>");
253
+
assertEquals(want, s.sanitize(input));
254
+
}
255
+
225
256
@Test
226
257
publicstaticfinalvoidtestIssue9StylesInTables() {
227
258
Stringinput = ""
@@ -500,7 +531,7 @@ public static final void testStyleGlobally() {
500
531
Stringwant = "<h1 style=\"color:green\">This is some green text</h1>";
0 commit comments