Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #451 from darkwing/link-fix-777218

fix bug 777218 - Detecting link with missing leading slash
  • Loading branch information...
commit fefca958fbcadc2d454c691ebb9691640f76af7e 2 parents e18f27f + bd3840d
@groovecoder groovecoder authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 media/ckeditor/plugins/mdn-link/dialogs/link.js
View
11 media/ckeditor/plugins/mdn-link/dialogs/link.js
@@ -1019,8 +1019,17 @@ CKEDITOR.dialog.add( 'link', function( editor )
case 'url':
var url = ( data.url && CKEDITOR.tools.trim( data.url.url ) ) || '',
useOriginal = url.indexOf( '/' ) === 0 || // ex: "/some/page"
- url.indexOf('#') === 0 || // ex: "someAnchor"
+ url.indexOf('#') === 0 || // ex: "#someAnchor"
url.indexOf('//') > -1; // ex: "http://mozilla.com" or "https://mozilla.com"
+
+ // Look for links starting with "en-US/more/stuff"
+ // We can spot that by the link not having a "." in the first split, i.e. "www."
+ if(!useOriginal) {
+ if(url.split('/')[0].indexOf('.') == -1) {
+ url = '/' + url;
+ useOriginal = true;
+ }
+ }
// Replace spaces in links
url = url.replace(/ /g, '_');
Please sign in to comment.
Something went wrong with that request. Please try again.