Skip to content
Permalink
Browse files

Merge branch 'PR#229'

  • Loading branch information...
mlewand committed Nov 1, 2015
2 parents 7856fe9 + b55b7e3 commit ac399b877afaadc2d9f5e187cc84140298a66a4b
Showing with 53 additions and 1 deletion.
  1. +1 −0 CHANGES.md
  2. +1 −1 plugins/link/dialogs/link.js
  3. +51 −0 tests/plugins/link/link.js
@@ -9,6 +9,7 @@ New Features:

Fixed Issues:

* [#13887](https://dev.ckeditor.com/ticket/13887): Fixed: Link target now supports wider ASCII character range. Thanks to [SamZiemer](https://github.com/SamZiemer)!
* [#13790](https://dev.ckeditor.com/ticket/13790): Fixed: Allow for the iframe having been removed already. Thanks to [Stefan Rijnhart](https://github.com/StefanRijnhart)!
* [#13803](https://dev.ckeditor.com/ticket/13803): Fixed: Allow the editor to be destroyed before being fully initialized. Thanks to [Cyril Fluck](https://github.com/cyril-sf)!
* [#13361](http://dev.ckeditor.com/ticket/13361): Fixed: Images fail when site path includes parentheses because background-image path needs single-quotes around URL value.
@@ -464,7 +464,7 @@
if ( !data.target )
data.target = {};

data.target.name = this.getValue().replace( /\W/gi, '' );
data.target.name = this.getValue().replace( /([^\x00-\x7F]|\s)/gi, '' );
}
} ]
},
@@ -229,6 +229,57 @@
// selection is <a>[b]</a> or [<a>b</a>].
assert.areSame( 'b', editor.getSelection().getSelectedText(), 'Link selected' );
} );
},

// #13887
'test link target special chars': function() {
var bot = this.editorBot;

bot.setHtmlWithSelection( '<a href="http://ckeditor.com">[foo]</a>' );

bot.dialog( 'link', function( dialog ) {
var funnyTargetValue = 'foo-b!ar^$`*(';

dialog.setValueOf( 'target', 'linkTargetType', 'frame' );
dialog.setValueOf( 'target', 'linkTargetName', funnyTargetValue );

dialog.getButton( 'ok' ).click();

assert.areSame( '<a href="http://ckeditor.com" target="' + funnyTargetValue + '">foo</a>', bot.getData( true ) );
} );
},

'test link target keywords': function() {
var bot = this.editorBot;

bot.setHtmlWithSelection( '<a href="http://ckeditor.com">[foo]</a>' );

bot.dialog( 'link', function( dialog ) {
dialog.setValueOf( 'target', 'linkTargetType', 'frame' );
dialog.setValueOf( 'target', 'linkTargetName', '_self' );

dialog.getButton( 'ok' ).click();

assert.areSame( '<a href="http://ckeditor.com" target="_self">foo</a>', bot.getData( true ) );
} );
},

// #5278
'test link target with space': function() {
var bot = this.editorBot;

bot.setHtmlWithSelection( '<a href="http://ckeditor.com">[foo]</a>' );

bot.dialog( 'link', function( dialog ) {
var funnyTargetValue = ' foo bar';

dialog.setValueOf( 'target', 'linkTargetType', 'frame' );
dialog.setValueOf( 'target', 'linkTargetName', funnyTargetValue );

dialog.getButton( 'ok' ).click();

assert.areSame( '<a href="http://ckeditor.com" target="foobar">foo</a>', bot.getData( true ) );
} );
}
} );
} )();

0 comments on commit ac399b8

Please sign in to comment.
You can’t perform that action at this time.