Skip to content

Commit

Permalink
Merge branch 't/14769' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Comandeer committed Feb 28, 2017
2 parents 2b6de50 + 9f77c1e commit f8e830b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion plugins/autolink/plugin.js
Expand Up @@ -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', {
Expand Down
5 changes: 3 additions & 2 deletions tests/plugins/autolink/autolink.js
Expand Up @@ -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;
Expand Down Expand Up @@ -165,4 +166,4 @@ bender.test( {

this.editor.execCommand( 'paste', pastedText );
}
} );
} );
20 changes: 20 additions & 0 deletions tests/plugins/autolink/manual/autolink.html
@@ -0,0 +1,20 @@
<h3>URLs that should be turned into links</h3>

<p>http://google.com/one_two_three</p>
<p>http://google.com/one_two_three/</p>
<p>http://www.google.com/one_two_three#anchor</p>
<p>https://www.google.com/test/?one=scoobydoobydoo&two=scoobydooby1doo&asdfgh</p>
<p>http://a.b-c.de</p>

<h3>URLs that shouldn't be turned into links</h3>

<p>http://google.com/URL encoded spaces please/</p>
<p>h://notarealprotocol</p>

<textarea id="editor1" cols="10" rows="10">
<p>Foo bar.</p>
</textarea>

<script>
CKEDITOR.replace( 'editor1' );
</script>
10 changes: 10 additions & 0 deletions tests/plugins/autolink/manual/autolink.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.

0 comments on commit f8e830b

Please sign in to comment.