Skip to content

Commit

Permalink
Merge branch 'PR#229'
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Nov 1, 2015
2 parents 7856fe9 + b55b7e3 commit ac399b8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion plugins/link/dialogs/link.js
Expand Up @@ -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, '' );
}
} ]
},
Expand Down
51 changes: 51 additions & 0 deletions tests/plugins/link/link.js
Expand Up @@ -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.