diff --git a/autolink.yml b/autolink.yml index 42c486d..b3d18ae 100644 --- a/autolink.yml +++ b/autolink.yml @@ -134,3 +134,104 @@ tests: - description: "Autolink trailing url" text: "text http://example.com" expected: "text http://example.com" + + - description: "Autolink url in mid-text" + text: "text http://example.com more text" + expected: "text http://example.com more text" + + - description: "Autolink url in Japanese text" + text: "いまなにしてるhttp://example.comいまなにしてる" + expected: "いまなにしてるhttp://example.comいまなにしてる" + + - description: "Autolink url surrounded by parentheses" + text: "text (http://example.com)" + expected: "text (http://example.com)" + + - description: "Autolink url followed by ? (without it)" + text: "text http://example.com?" + expected: "text http://example.com?" + + - description: "Autolink url followed by ! (without it)" + text: "text http://example.com!" + expected: "text http://example.com!" + + - description: "Autolink url followed by , (without it)" + text: "text http://example.com," + expected: "text http://example.com," + + - description: "Autolink url followed by . (without it)" + text: "text http://example.com." + expected: "text http://example.com." + + - description: "Autolink url followed by : (without it)" + text: "text http://example.com:" + expected: "text http://example.com:" + + - description: "Autolink url followed by ; (without it)" + text: "text http://example.com;" + expected: "text http://example.com;" + + - description: "Autolink url followed by ] (without it)" + text: "text http://example.com]" + expected: "text http://example.com]" + + - description: "Autolink url followed by ) (without it)" + text: "text http://example.com)" + expected: "text http://example.com)" + + - description: "Autolink url followed by } (without it)" + text: "text http://example.com}" + expected: "text http://example.com}" + + - description: "Autolink url followed by = (without it)" + text: "text http://example.com=" + expected: "text http://example.com=" + + - description: "Autolink url followed by \ (without it)" + text: "text http://example.com\\" + expected: "text http://example.com\\" + + - description: "Autolink url followed by ' (without it)" + text: "text http://example.com'" + expected: "text http://example.com'" + +########## FIXME +# - description: "DO NOT Autolink url preceded by \\" +# text: "text \\http://example.com" +# expected: "text \\http://example.com" + + - description: "DO NOT Autolink url preceded by '" + text: "text 'http://example.com" + expected: "text 'http://example.com" + + - description: "DO NOT Autolink url preceded by /" + text: "text /http://example.com" + expected: "text /http://example.com" + + - description: "DO NOT Autolink url preceded by :" + text: "text :http://example.com" + expected: "text :http://example.com" + + - description: "DO NOT Autolink url preceded by !" + text: "text !http://example.com" + expected: "text !http://example.com" + + - description: "DO NOT Autolink url preceded by =" + text: "text =http://example.com" + expected: "text =http://example.com" + + - description: "Autolink url embedded in link tag" + text: "http://example.com" + expected: "http://example.com" + + - description: "Autolink multiple urls" + text: "http://example.com https://sslexample.com http://sub.example.com" + expected: "http://example.com https://sslexample.com http://sub.example.com" + + - description: "Autolink url with long TLD" + text: "http://example.mobi/path" + expected: "http://example.mobi/path" + + - description: "Autolink url without protocol (with www)" + text: "www.example.com" + expected: "www.example.com"