From 8dd2a9eef724efed2ac1ba72d57da7ea24fb6553 Mon Sep 17 00:00:00 2001 From: Tadeusz Piskozub Date: Mon, 27 Feb 2017 10:26:12 +0100 Subject: [PATCH 1/5] Tests: add test case for link with hyphen. --- tests/plugins/autolink/autolink.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/plugins/autolink/autolink.js b/tests/plugins/autolink/autolink.js index 43cc89d34aa..4159dbb900e 100644 --- a/tests/plugins/autolink/autolink.js +++ b/tests/plugins/autolink/autolink.js @@ -78,7 +78,8 @@ bender.test( { 'https://placekitten.com/g/180/300', 'http://giphy.com/gifs/space-nasa-test-GDiDCTh9AjbiM', 'https://www.google.pl/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=ebay', - 'http://www.legia.sport.pl/legia/1,139320,18079195.html#MTstream' + 'http://www.legia.sport.pl/legia/1,139320,18079195.html#MTstream', + 'http://a.b-c.de' ]; var pastedText; @@ -165,4 +166,4 @@ bender.test( { this.editor.execCommand( 'paste', pastedText ); } -} ); \ No newline at end of file +} ); From 01f50d1bfb413f6dbd920c2ad626f5b0ccf68d2d Mon Sep 17 00:00:00 2001 From: Tadeusz Piskozub Date: Mon, 27 Feb 2017 10:26:40 +0100 Subject: [PATCH 2/5] Modify regex so it covers one additional, popular case. --- plugins/autolink/plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/autolink/plugin.js b/plugins/autolink/plugin.js index a2881eb55fe..20a8353bdb0 100644 --- a/plugins/autolink/plugin.js +++ b/plugins/autolink/plugin.js @@ -7,7 +7,7 @@ 'use strict'; // Regex by Imme Emosol. - var validUrlRegex = /^(https?|ftp):\/\/(-\.)?([^\s\/?\.#-]+\.?)+(\/[^\s]*)?[^\s\.,]$/ig, + var validUrlRegex = /^(https?|ftp):\/\/(-\.)?([^\s\/?\.#]+\.?)+(\/[^\s]*)?[^\s\.,]$/ig, doubleQuoteRegex = /"/g; CKEDITOR.plugins.add( 'autolink', { From a97e081757dc8afd100173ea7940567d9134fd91 Mon Sep 17 00:00:00 2001 From: Tadeusz Piskozub Date: Mon, 27 Feb 2017 11:08:31 +0100 Subject: [PATCH 3/5] Tests: add manual test. --- tests/plugins/autolink/manual/1.html | 20 ++++++++++++++++++++ tests/plugins/autolink/manual/1.md | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/plugins/autolink/manual/1.html create mode 100644 tests/plugins/autolink/manual/1.md diff --git a/tests/plugins/autolink/manual/1.html b/tests/plugins/autolink/manual/1.html new file mode 100644 index 00000000000..d4c03bf02a8 --- /dev/null +++ b/tests/plugins/autolink/manual/1.html @@ -0,0 +1,20 @@ +

URLs that should be turned into links

+ +

http://google.com/one_two_three

+

http://google.com/one_two_three/

+

http://www.google.com/one_two_three#anchor

+

https://www.google.com/test/?one=scoobydoobydoo&two=scoobydooby1doo&asdfgh

+

http://a.b-c.de

+ +

URLs that shouldn't be turned into links

+ +

http://google.com/URL encoded spaces please/

+

h://notarealprotocol

+ + + + diff --git a/tests/plugins/autolink/manual/1.md b/tests/plugins/autolink/manual/1.md new file mode 100644 index 00000000000..69bceaa84eb --- /dev/null +++ b/tests/plugins/autolink/manual/1.md @@ -0,0 +1,10 @@ +@bender-ui: collapsed +@bender-tags: 4.7.0, tc, 14769 +@bender-ckeditor-plugins: clipboard, toolbar, wysiwygarea, elementspath, link, autolink + +## Test Scenario + +Paste each URL to the editor and check whether it's turned into a link. + + +Make sure you copy the URLs without trailing spaces. From 32fbe9a43e61edecb4f630ea5b2681048ac735ef Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Tue, 28 Feb 2017 07:35:26 +0100 Subject: [PATCH 4/5] Updated manual test name. --- tests/plugins/autolink/manual/{1.html => autolink.html} | 0 tests/plugins/autolink/manual/{1.md => autolink.md} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/plugins/autolink/manual/{1.html => autolink.html} (100%) rename tests/plugins/autolink/manual/{1.md => autolink.md} (100%) diff --git a/tests/plugins/autolink/manual/1.html b/tests/plugins/autolink/manual/autolink.html similarity index 100% rename from tests/plugins/autolink/manual/1.html rename to tests/plugins/autolink/manual/autolink.html diff --git a/tests/plugins/autolink/manual/1.md b/tests/plugins/autolink/manual/autolink.md similarity index 100% rename from tests/plugins/autolink/manual/1.md rename to tests/plugins/autolink/manual/autolink.md From 9f77c1e962ad8a57df1cce00b160728f644ca517 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Tue, 28 Feb 2017 07:56:58 +0100 Subject: [PATCH 5/5] Updated changelog. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index bb6bb987aca..9c53f76091c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -20,6 +20,7 @@ Fixed Issues: * [#10472](http://dev.ckeditor.com/ticket/10472): Fixed: Unable to use [Table Resize](http://ckeditor.com/addon/tableresize) on table's header and footer. * [#16777](https://dev.ckeditor.com/ticket/16777): [Edge] Fixed: [Clipboard](http://ckeditor.com/addon/clipboard) plugin doesn't allow to drop widgets into editor. * [#14894](https://dev.ckeditor.com/ticket/14894): [Chrome] Fixed: Editor scrolls to top after focusing or when a dialog is opened. +* [#14769](https://dev.ckeditor.com/ticket/14769): Fixed: URLs with '-' in host are not detected by [Autolink](http://ckeditor.com/addon/autolink) plugin. ## CKEditor 4.6.2