diff --git a/CHANGES.md b/CHANGES.md
index a909c97f6c3..73a5a0a4fca 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -5,11 +5,12 @@ CKEditor 4 Changelog
Fixed Issues:
-* [#13232](http://dev.ckeditor.com/ticket/13232): [Safari] Fixed: Method [`element.appendText()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-appendText) work properly for empty elements.
-* [#13233](http://dev.ckeditor.com/ticket/13233): Fixed: HTMLDataProcessor can process `foo:href` attributes.
* [#12899](http://dev.ckeditor.com/ticket/12899): Fixed: Corrected wrong tag ending for horizontal box definition in the [Dialog User Interface](http://ckeditor.com/addon/dialogui) plugin. Thanks to [mizafish](https://github.com/mizafish)!
* [#13254](http://dev.ckeditor.com/ticket/13254): Fixed: Cannot outdent block after indent when using [Divarea](http://ckeditor.com/addon/divarea) plugin. Thanks to [Jonathan Cottrill](https://github.com/jcttrll)!
* [#13268](http://dev.ckeditor.com/ticket/13268): Fixed: Documentation for `CKEDITOR.dom.text` is incorrect. Thanks to [Ben Kiefer](https://github.com/benkiefer)!
+* [#12739](http://dev.ckeditor.com/ticket/12739): Fixed: Link loses inline styles when edited without dialogadvtab. Thanks to [Віталій Крутько](https://github.com/asmforce)!
+* [#13232](http://dev.ckeditor.com/ticket/13232): [Safari] Fixed: Method [`element.appendText()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-appendText) work properly for empty elements.
+* [#13233](http://dev.ckeditor.com/ticket/13233): Fixed: HTMLDataProcessor can process `foo:href` attributes.
* [#12796](http://dev.ckeditor.com/ticket/12796): Fixed: The [Indent List](http://ckeditor.com/addon/indentlist) plugin unwraps parent `
` elements.
* [#12885](http://dev.ckeditor.com/ticket/12885): Added missing [`editor.getData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getData) parameter documentation.
* [#11982](http://dev.ckeditor.com/ticket/11982): Bullet added in wrong position after the *Enter* key is pressed in a nested list.
diff --git a/plugins/link/plugin.js b/plugins/link/plugin.js
index cb7ff9a303d..3b93e6bacd9 100755
--- a/plugins/link/plugin.js
+++ b/plugins/link/plugin.js
@@ -677,12 +677,15 @@
if ( set[ 'data-cke-saved-href' ] )
set.href = set[ 'data-cke-saved-href' ];
- var removed = CKEDITOR.tools.extend( {
+ var removed = {
target: 1,
onclick: 1,
'data-cke-pa-onclick': 1,
'data-cke-saved-name': 1
- }, advAttrNames );
+ };
+
+ if ( data.advanced )
+ CKEDITOR.tools.extend( removed, advAttrNames );
// Remove all attributes which are not currently set.
for ( var s in set )
diff --git a/tests/plugins/link/manual/advattributesarekeptwhenadvtabdisabled.html b/tests/plugins/link/manual/advattributesarekeptwhenadvtabdisabled.html
new file mode 100644
index 00000000000..9886c548cae
--- /dev/null
+++ b/tests/plugins/link/manual/advattributesarekeptwhenadvtabdisabled.html
@@ -0,0 +1,10 @@
+
+
+
\ No newline at end of file
diff --git a/tests/plugins/link/manual/advattributesarekeptwhenadvtabdisabled.md b/tests/plugins/link/manual/advattributesarekeptwhenadvtabdisabled.md
new file mode 100644
index 00000000000..95452df4c77
--- /dev/null
+++ b/tests/plugins/link/manual/advattributesarekeptwhenadvtabdisabled.md
@@ -0,0 +1,7 @@
+@bender-tags: link, tc, 4.4.8
+@bender-ui: collapsed
+@bender-ckeditor-plugins: link,toolbar,wysiwygarea,sourcearea
+
+1. Edit the link (change URL to "bar").
+2. Switch to source mode.
+3. Link should contain `class="foo"`, red border, `tabindex="555"` and the `href` that you set.
\ No newline at end of file
diff --git a/tests/plugins/link/utils.js b/tests/plugins/link/utils.js
index c94556f21c8..341ec42bdd5 100644
--- a/tests/plugins/link/utils.js
+++ b/tests/plugins/link/utils.js
@@ -67,22 +67,10 @@
bender.test( {
'test link attributes - no link': function() {
assertLink( this.editorBot, '', {}, {}, [
- 'accessKey',
- 'charset',
- 'class',
'data-cke-pa-onclick',
'data-cke-saved-name',
- 'dir',
- 'id',
- 'lang',
- 'name',
'onclick',
- 'rel',
- 'style',
- 'tabindex',
- 'target',
- 'title',
- 'type'
+ 'target'
] );
},
@@ -139,7 +127,7 @@
},
'test link attributes - mailto': function() {
- var html = 'foo';
+ var html = 'foo';
assertLink( this.editorBot, html,
{
@@ -148,9 +136,15 @@
address: 'foo',
subject: 'bar',
body: 'bam'
+ },
+ advanced: {
+ advId: 'some_link',
+ advStyles: 'text-decoration:none'
}
}, {
'data-cke-saved-href': 'mailto:foo?subject=bar&body=bam',
+ id: 'some_link',
+ style: 'text-decoration:none',
href: 'mailto:foo?subject=bar&body=bam'
},
[
@@ -160,12 +154,10 @@
'data-cke-pa-onclick',
'data-cke-saved-name',
'dir',
- 'id',
'lang',
'name',
'onclick',
'rel',
- 'style',
'tabindex',
'target',
'title',
@@ -174,7 +166,7 @@
},
'test link attributes - simple': function() {
- var html = 'foo';
+ var html = 'foo';
assertLink( this.editorBot, html,
{
@@ -182,9 +174,15 @@
url: {
protocol: 'http://',
url: 'x'
+ },
+ advanced: {
+ advId: 'some_link',
+ advStyles: 'text-decoration:none'
}
}, {
'data-cke-saved-href': 'http://x',
+ id: 'some_link',
+ style: 'text-decoration:none',
href: 'http://x'
},
[
@@ -194,12 +192,10 @@
'data-cke-pa-onclick',
'data-cke-saved-name',
'dir',
- 'id',
'lang',
'name',
'onclick',
'rel',
- 'style',
'tabindex',
'target',
'title',
@@ -222,27 +218,15 @@
href: '#a'
},
[
- 'accessKey',
- 'charset',
- 'class',
'data-cke-pa-onclick',
'data-cke-saved-name',
- 'dir',
- 'id',
- 'lang',
- 'name',
'onclick',
- 'rel',
- 'style',
- 'tabindex',
- 'target',
- 'title',
- 'type'
+ 'target'
] );
},
'test link attributes - target popup': function() {
- var html = 'foo';
assertLink( this.editorBot, html,
@@ -267,11 +251,17 @@
left: '20',
height: '30',
top: '40'
+ },
+ advanced: {
+ advId: 'some_link',
+ advStyles: 'text-decoration:none'
}
}, {
'data-cke-saved-href': 'http://foo',
'data-cke-pa-onclick': 'window.open(this.href, \'pop\', \'resizable=yes,status=yes,location=yes,toolbar=yes,menubar=yes,fullscreen=yes,' +
'scrollbars=yes,dependent=yes,width=10,left=20,height=30,top=40\'); return false;',
+ id: 'some_link',
+ style: 'text-decoration:none',
href: 'http://foo'
},
[
@@ -280,21 +270,18 @@
'class',
'data-cke-saved-name',
'dir',
- 'id',
'lang',
'name',
'onclick',
'rel',
- 'style',
'tabindex',
'target',
- 'title',
- 'type'
+ 'title,type'
] );
},
'test link attributes - target _top': function() {
- var html = 'foo';
+ var html = 'foo';
assertLink( this.editorBot, html,
{
@@ -306,10 +293,16 @@
target: {
type: '_top',
name: '_top'
+ },
+ advanced: {
+ advId: 'some_link',
+ advStyles: 'text-decoration:none'
}
}, {
'data-cke-saved-href': 'http://x',
target: '_top',
+ id: 'some_link',
+ style: 'text-decoration:none',
href: 'http://x'
},
[
@@ -319,12 +312,10 @@
'data-cke-pa-onclick',
'data-cke-saved-name',
'dir',
- 'id',
'lang',
'name',
'onclick',
'rel',
- 'style',
'tabindex',
'title',
'type'