From a59af0a67a63bb2dfc9942b3df90abebf0f9dbc3 Mon Sep 17 00:00:00 2001 From: Karol Dawidziuk Date: Thu, 27 May 2021 12:32:05 +0200 Subject: [PATCH 01/10] prevent duplicate anchors --- plugins/link/dialogs/anchor.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/plugins/link/dialogs/anchor.js b/plugins/link/dialogs/anchor.js index 8b9cade7e14..6634e394c6b 100755 --- a/plugins/link/dialogs/anchor.js +++ b/plugins/link/dialogs/anchor.js @@ -30,12 +30,38 @@ CKEDITOR.dialog.add( 'anchor', function( editor ) { element = element.getParent(); } + // If anchor is exist and has some styles go to the closest parent tag. (#3863) + if ( element && !element.is( 'a' ) ) { + element = element.getAscendant( 'a' ) || element; + } + if ( element && element.type === CKEDITOR.NODE_ELEMENT && ( element.data( 'cke-real-element-type' ) === 'anchor' || element.is( 'a' ) ) ) { return element; } } + // Checks if range contains some nested anchors and remove it. + function checkNestedAnchors( range ) { + var newRange = range.clone(); + newRange.enlarge( CKEDITOR.ENLARGE_ELEMENT ); + + var walker = new CKEDITOR.dom.walker( newRange ), + element = newRange.collapsed ? newRange.startContainer : walker.next(), + // Create bookmark to save actual range before removing anchors + bookmark = range.createBookmark(); + + while ( element ) { + // Remove anchor if it exist + if ( element.type === CKEDITOR.NODE_ELEMENT && element.getAttribute( 'data-cke-saved-name' ) ) { + element.remove( true ); + } + element = walker.next(); + } + // restore range + range.moveToBookmark( bookmark ); + } + return { title: editor.lang.link.anchor.title, minWidth: 300, @@ -76,6 +102,7 @@ CKEDITOR.dialog.add( 'anchor', function( editor ) { if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) attributes[ 'class' ] = 'cke_anchor'; + checkNestedAnchors( range ); // Apply style. var style = new CKEDITOR.style( { element: 'a', attributes: attributes } ); style.type = CKEDITOR.STYLE_INLINE; From f73b638d62bff0e565b2f3c7e9b75ee3d17b9782 Mon Sep 17 00:00:00 2001 From: Karol Dawidziuk Date: Thu, 27 May 2021 12:32:36 +0200 Subject: [PATCH 02/10] add unit tests --- tests/plugins/link/anchor.js | 42 +++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/tests/plugins/link/anchor.js b/tests/plugins/link/anchor.js index 716ce0379cc..8cf932f10ca 100644 --- a/tests/plugins/link/anchor.js +++ b/tests/plugins/link/anchor.js @@ -1,5 +1,5 @@ /* bender-tags: editor */ -/* bender-ckeditor-plugins: link,toolbar */ +/* bender-ckeditor-plugins: link,toolbar,basicstyles */ ( function() { 'use strict'; @@ -79,6 +79,46 @@ assert.areSame( anchor, dialog.getModel( editor ) ); } ); } ); + }, + + // (#3863) + 'test preserve duplicate anchors after editing word with custom style': function() { + var editor = this.editor, + bot = this.editorBot, + html = '

text

'; + + bot.setData( html, function() { + var range = editor.createRange(), + anchor = editor.editable().findOne( '#test' ), + textNode = anchor.getChild( 0 ); + + range.selectNodeContents( textNode ); + range.select(); + + bot.dialog( 'anchor', function( dialog ) { + dialog.setValueOf( 'info', 'txtName', 'duplicate-test' ); + dialog.getButton( 'ok' ).click(); + + assert.areSame( anchor, dialog.getModel( editor ) ); + } ); + + } ); + }, + + // (#4728) + 'test prevent duplicate anchors in selected multi words with styles': function() { + var editor = this.editor, + bot = this.editorBot, + template = '[

Simple text

]', + expected = '

Simple text

'; + + bot.setHtmlWithSelection( template ); + bot.dialog( 'anchor', function( dialog ) { + dialog.setValueOf( 'info', 'txtName', 'multiTestResult' ); + dialog.getButton( 'ok' ).click(); + + assert.beautified.html( expected, editor.getData() ); + } ); } } ); }() ); From 926ca801262615143f4a574f26fab3beb15dae85 Mon Sep 17 00:00:00 2001 From: Karol Dawidziuk Date: Sun, 30 May 2021 14:33:36 +0200 Subject: [PATCH 03/10] remove unnecessary comments and change function name --- plugins/link/dialogs/anchor.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugins/link/dialogs/anchor.js b/plugins/link/dialogs/anchor.js index 6634e394c6b..ad328cb0ede 100755 --- a/plugins/link/dialogs/anchor.js +++ b/plugins/link/dialogs/anchor.js @@ -30,7 +30,7 @@ CKEDITOR.dialog.add( 'anchor', function( editor ) { element = element.getParent(); } - // If anchor is exist and has some styles go to the closest parent tag. (#3863) + // If anchor exists and has any styles find the closest parent tag. (#3863) if ( element && !element.is( 'a' ) ) { element = element.getAscendant( 'a' ) || element; } @@ -41,24 +41,20 @@ CKEDITOR.dialog.add( 'anchor', function( editor ) { } } - // Checks if range contains some nested anchors and remove it. - function checkNestedAnchors( range ) { + function removeAnchorsWithinRange( range ) { var newRange = range.clone(); newRange.enlarge( CKEDITOR.ENLARGE_ELEMENT ); var walker = new CKEDITOR.dom.walker( newRange ), element = newRange.collapsed ? newRange.startContainer : walker.next(), - // Create bookmark to save actual range before removing anchors bookmark = range.createBookmark(); while ( element ) { - // Remove anchor if it exist if ( element.type === CKEDITOR.NODE_ELEMENT && element.getAttribute( 'data-cke-saved-name' ) ) { element.remove( true ); } element = walker.next(); } - // restore range range.moveToBookmark( bookmark ); } @@ -102,7 +98,8 @@ CKEDITOR.dialog.add( 'anchor', function( editor ) { if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) attributes[ 'class' ] = 'cke_anchor'; - checkNestedAnchors( range ); + // (#4728) + removeAnchorsWithinRange( range ); // Apply style. var style = new CKEDITOR.style( { element: 'a', attributes: attributes } ); style.type = CKEDITOR.STYLE_INLINE; From 6adf7dd3201098f721f3e5af1ad0f8c1183dd748 Mon Sep 17 00:00:00 2001 From: Karol Dawidziuk Date: Sun, 30 May 2021 14:34:19 +0200 Subject: [PATCH 04/10] fix typos and add more unit tests --- tests/plugins/link/anchor.js | 90 +++++++++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 17 deletions(-) diff --git a/tests/plugins/link/anchor.js b/tests/plugins/link/anchor.js index 8cf932f10ca..62c2027aeb8 100644 --- a/tests/plugins/link/anchor.js +++ b/tests/plugins/link/anchor.js @@ -82,31 +82,23 @@ }, // (#3863) - 'test preserve duplicate anchors after editing word with custom style': function() { + 'test prevent duplicated anchors after editing a word with custom style': function() { var editor = this.editor, bot = this.editorBot, - html = '

text

'; + template = '[

text

]', + expected = '

text

'; - bot.setData( html, function() { - var range = editor.createRange(), - anchor = editor.editable().findOne( '#test' ), - textNode = anchor.getChild( 0 ); - - range.selectNodeContents( textNode ); - range.select(); - - bot.dialog( 'anchor', function( dialog ) { - dialog.setValueOf( 'info', 'txtName', 'duplicate-test' ); - dialog.getButton( 'ok' ).click(); - - assert.areSame( anchor, dialog.getModel( editor ) ); - } ); + bot.setHtmlWithSelection( template ); + bot.dialog( 'anchor', function( dialog ) { + dialog.setValueOf( 'info', 'txtName', 'duplicate-test' ); + dialog.getButton( 'ok' ).click(); + assert.beautified.html( expected, editor.getData() ); } ); }, // (#4728) - 'test prevent duplicate anchors in selected multi words with styles': function() { + 'test prevent duplicated anchors after editing multiple words with styles': function() { var editor = this.editor, bot = this.editorBot, template = '[

Simple text

]', @@ -117,6 +109,70 @@ dialog.setValueOf( 'info', 'txtName', 'multiTestResult' ); dialog.getButton( 'ok' ).click(); + assert.beautified.html( expected, editor.getData() ); + } ); + }, + + // (#4728) + 'test prevent duplicated anchors in the selection: strong > em': function() { + var editor = this.editor, + bot = this.editorBot, + template = '

[SimpleTest]

', + expected = '

SimpleTest

'; + + bot.setHtmlWithSelection( template ); + bot.dialog( 'anchor', function( dialog ) { + dialog.setValueOf( 'info', 'txtName', 'nested' ); + dialog.getButton( 'ok' ).click(); + + assert.beautified.html( expected, editor.getData() ); + } ); + }, + + // (#4728) + 'test prevent duplicated anchors in the selection of multiline with styled words': function() { + var editor = this.editor, + bot = this.editorBot, + template = '[

Simple

test

]', + expected = '

Simple

test

'; + + bot.setHtmlWithSelection( template ); + bot.dialog( 'anchor', function( dialog ) { + dialog.setValueOf( 'info', 'txtName', 'multiLine' ); + dialog.getButton( 'ok' ).click(); + + assert.beautified.html( expected, editor.getData() ); + } ); + }, + + // (#4728) + 'test prevent duplicated anchors in the unordered list with styled word': function() { + var editor = this.editor, + bot = this.editorBot, + template = '[]', + expected = ''; + + bot.setHtmlWithSelection( template ); + bot.dialog( 'anchor', function( dialog ) { + dialog.setValueOf( 'info', 'txtName', 'unorderedList' ); + dialog.getButton( 'ok' ).click(); + + assert.beautified.html( expected, editor.getData() ); + } ); + }, + + // (#4728) + 'test prevent duplicated anchors in the ordered list with styled word': function() { + var editor = this.editor, + bot = this.editorBot, + template = '[
  1. test
]', + expected = '
  1. test
'; + + bot.setHtmlWithSelection( template ); + bot.dialog( 'anchor', function( dialog ) { + dialog.setValueOf( 'info', 'txtName', 'orderedList' ); + dialog.getButton( 'ok' ).click(); + assert.beautified.html( expected, editor.getData() ); } ); } From 28f82bda60fffb9692b5c7930dfc3590278d55ae Mon Sep 17 00:00:00 2001 From: Karol Dawidziuk Date: Sun, 30 May 2021 14:34:36 +0200 Subject: [PATCH 05/10] add manual tests --- .../link/manual/anchorcustomstyles.html | 52 +++++++++++++++++++ .../plugins/link/manual/anchorcustomstyles.md | 18 +++++++ 2 files changed, 70 insertions(+) create mode 100644 tests/plugins/link/manual/anchorcustomstyles.html create mode 100644 tests/plugins/link/manual/anchorcustomstyles.md diff --git a/tests/plugins/link/manual/anchorcustomstyles.html b/tests/plugins/link/manual/anchorcustomstyles.html new file mode 100644 index 00000000000..2195971fea7 --- /dev/null +++ b/tests/plugins/link/manual/anchorcustomstyles.html @@ -0,0 +1,52 @@ +
+ +

Test

+ +

Test anchor

+ +

test test

+ +

Test heading styled words

+ +
    +
  • first
  • +
  • second item
  • +
  • thrid
  • +
+ +
    +
  1. ordered list
  2. +
  3. test
  4. +
+ + + + + + + + + + + + + + + + + + + + + + + + +
testtest
test
test
test
test
test
test
test
test
+
+ + \ No newline at end of file diff --git a/tests/plugins/link/manual/anchorcustomstyles.md b/tests/plugins/link/manual/anchorcustomstyles.md new file mode 100644 index 00000000000..a39b224bd88 --- /dev/null +++ b/tests/plugins/link/manual/anchorcustomstyles.md @@ -0,0 +1,18 @@ +@bender-tags: 4.16.1, bug, link, 4728 +@bender-ui: collapsed +@bender-ckeditor-plugins: link, toolbar, wysiwygarea, basicstyles, sourcearea, clipboard, enterkey, link, list, liststyle, tabletools, tableselection, undo, format + +Play with the anchors. + +Things to check: + +* creating anchors, +* creating anchors with styled words, +* creating anchors with heavily styled content ( p>em>strong> etc.), +* creating anchors with different paragraph format, +* creating anchors with multiline words, +* modifying existing anchors. + +Notes: +* Testing multiline creating anchors should create anchors for each line. +* Editing a few words with an existing anchor should replace it with one for the entire range. \ No newline at end of file From 83b70a3c9904a58ef419cadf74ea20e4e8c3a9bd Mon Sep 17 00:00:00 2001 From: Karol Dawidziuk Date: Tue, 22 Jun 2021 14:56:16 +0200 Subject: [PATCH 06/10] fix remove multiple anchors --- plugins/link/dialogs/anchor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/link/dialogs/anchor.js b/plugins/link/dialogs/anchor.js index ad328cb0ede..f86c1e81388 100755 --- a/plugins/link/dialogs/anchor.js +++ b/plugins/link/dialogs/anchor.js @@ -52,6 +52,9 @@ CKEDITOR.dialog.add( 'anchor', function( editor ) { while ( element ) { if ( element.type === CKEDITOR.NODE_ELEMENT && element.getAttribute( 'data-cke-saved-name' ) ) { element.remove( true ); + // Reset the walker and start from beginning, to check if element has more nested anchors. + // Without it, next element is null, so there might be space to more nested elements. + walker.reset(); } element = walker.next(); } From 644ad857ba9c21ab9c24caff68b56311135dcd87 Mon Sep 17 00:00:00 2001 From: Karol Dawidziuk Date: Tue, 22 Jun 2021 14:57:09 +0200 Subject: [PATCH 07/10] add missing unit test case and add missing plugin into manual test --- tests/plugins/link/anchor.js | 16 ++++++++++++++++ .../plugins/link/manual/anchorcustomstyles.html | 2 +- tests/plugins/link/manual/anchorcustomstyles.md | 8 ++++---- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/tests/plugins/link/anchor.js b/tests/plugins/link/anchor.js index 62c2027aeb8..e4cedff1b9d 100644 --- a/tests/plugins/link/anchor.js +++ b/tests/plugins/link/anchor.js @@ -129,6 +129,22 @@ } ); }, + // (#4728) + 'test prevent duplicated anchors in the selection: strong > em > span': function() { + var editor = this.editor, + bot = this.editorBot, + template = '

[test]

', + expected = '

test

'; + + bot.setHtmlWithSelection( template ); + bot.dialog( 'anchor', function( dialog ) { + dialog.setValueOf( 'info', 'txtName', 'emphasize' ); + dialog.getButton( 'ok' ).click(); + + assert.beautified.html( expected, editor.getData() ); + } ); + }, + // (#4728) 'test prevent duplicated anchors in the selection of multiline with styled words': function() { var editor = this.editor, diff --git a/tests/plugins/link/manual/anchorcustomstyles.html b/tests/plugins/link/manual/anchorcustomstyles.html index 2195971fea7..d09f89d6128 100644 --- a/tests/plugins/link/manual/anchorcustomstyles.html +++ b/tests/plugins/link/manual/anchorcustomstyles.html @@ -49,4 +49,4 @@

Test heading styled words

var editor = CKEDITOR.replace('editor', { height: 500 }); - \ No newline at end of file + diff --git a/tests/plugins/link/manual/anchorcustomstyles.md b/tests/plugins/link/manual/anchorcustomstyles.md index a39b224bd88..04143121364 100644 --- a/tests/plugins/link/manual/anchorcustomstyles.md +++ b/tests/plugins/link/manual/anchorcustomstyles.md @@ -1,6 +1,6 @@ @bender-tags: 4.16.1, bug, link, 4728 @bender-ui: collapsed -@bender-ckeditor-plugins: link, toolbar, wysiwygarea, basicstyles, sourcearea, clipboard, enterkey, link, list, liststyle, tabletools, tableselection, undo, format +@bender-ckeditor-plugins: link, toolbar, wysiwygarea, basicstyles, sourcearea, clipboard, enterkey, link, list, liststyle, tabletools, tableselection, undo, format, elementspath Play with the anchors. @@ -13,6 +13,6 @@ Things to check: * creating anchors with multiline words, * modifying existing anchors. -Notes: -* Testing multiline creating anchors should create anchors for each line. -* Editing a few words with an existing anchor should replace it with one for the entire range. \ No newline at end of file +Notes: +* Testing multiline creating anchors should create anchors for each line. +* Editing a few words with an existing anchor should replace it with one for the entire range. From 1805f59b7708ab4a09d45c1c6f97d33d9f87e871 Mon Sep 17 00:00:00 2001 From: Karol Dawidziuk Date: Mon, 19 Jul 2021 14:52:13 +0200 Subject: [PATCH 08/10] convert monkey-clicking manual test to more specyfic --- .../link/manual/anchorcustomstyles.html | 49 +------------------ .../plugins/link/manual/anchorcustomstyles.md | 30 +++++++----- 2 files changed, 21 insertions(+), 58 deletions(-) diff --git a/tests/plugins/link/manual/anchorcustomstyles.html b/tests/plugins/link/manual/anchorcustomstyles.html index d09f89d6128..ee5d729b8e7 100644 --- a/tests/plugins/link/manual/anchorcustomstyles.html +++ b/tests/plugins/link/manual/anchorcustomstyles.html @@ -1,52 +1,7 @@
- -

Test

- -

Test anchor

- -

test test

- -

Test heading styled words

- -
    -
  • first
  • -
  • second item
  • -
  • thrid
  • -
- -
    -
  1. ordered list
  2. -
  3. test
  4. -
- - - - - - - - - - - - - - - - - - - - - - - - -
testtest
test
test
test
test
test
test
test
test
+

Hello world!

diff --git a/tests/plugins/link/manual/anchorcustomstyles.md b/tests/plugins/link/manual/anchorcustomstyles.md index 04143121364..9994f33ebc4 100644 --- a/tests/plugins/link/manual/anchorcustomstyles.md +++ b/tests/plugins/link/manual/anchorcustomstyles.md @@ -2,17 +2,25 @@ @bender-ui: collapsed @bender-ckeditor-plugins: link, toolbar, wysiwygarea, basicstyles, sourcearea, clipboard, enterkey, link, list, liststyle, tabletools, tableselection, undo, format, elementspath -Play with the anchors. +### Scenario 1 +1. Select `world!`. +1. Add an anchor. +1. Edit existing anchor and save it. -Things to check: +**Expected result:** +There is one anchor with changed `id` and `name`. -* creating anchors, -* creating anchors with styled words, -* creating anchors with heavily styled content ( p>em>strong> etc.), -* creating anchors with different paragraph format, -* creating anchors with multiline words, -* modifying existing anchors. +**Unexpected result:** +Anchors was doubled. -Notes: -* Testing multiline creating anchors should create anchors for each line. -* Editing a few words with an existing anchor should replace it with one for the entire range. +### Scenario 2 +1. Select `world!` and add an anchor. +1. Select `Hello World!` and add an anchor. +1. Edit anchor and save it. + + +**Expected result:** +There is one anchor: `Hello World!`. + +**Unexpected result:** +There are three anchors: One in `Hello` and doubled in `world!`. From 621f93e11886b8a8050539c13a24277266f0bb73 Mon Sep 17 00:00:00 2001 From: Karol Dawidziuk Date: Tue, 20 Jul 2021 09:37:13 +0200 Subject: [PATCH 09/10] remove manual tests; add custom message when test fails; add one more unit test case --- tests/plugins/link/anchor.js | 30 ++++++++++++++----- .../link/manual/anchorcustomstyles.html | 7 ----- .../plugins/link/manual/anchorcustomstyles.md | 26 ---------------- 3 files changed, 23 insertions(+), 40 deletions(-) delete mode 100644 tests/plugins/link/manual/anchorcustomstyles.html delete mode 100644 tests/plugins/link/manual/anchorcustomstyles.md diff --git a/tests/plugins/link/anchor.js b/tests/plugins/link/anchor.js index e4cedff1b9d..774ff76f056 100644 --- a/tests/plugins/link/anchor.js +++ b/tests/plugins/link/anchor.js @@ -93,7 +93,23 @@ dialog.setValueOf( 'info', 'txtName', 'duplicate-test' ); dialog.getButton( 'ok' ).click(); - assert.beautified.html( expected, editor.getData() ); + assert.beautified.html( expected, editor.getData(), 'Prevent duplicated anchors failed after editing a word with custom style' ); + } ); + }, + + // (#4728) + 'test prevent duplicated anchors': function() { + var editor = this.editor, + bot = this.editorBot, + template = '[

Hello world!

]', + expected = '

Hello world!

'; + + bot.setHtmlWithSelection( template ); + bot.dialog( 'anchor', function( dialog ) { + dialog.setValueOf( 'info', 'txtName', 'helloWorld' ); + dialog.getButton( 'ok' ).click(); + + assert.beautified.html( expected, editor.getData(), 'Prevent duplicated anchors failed' ); } ); }, @@ -109,7 +125,7 @@ dialog.setValueOf( 'info', 'txtName', 'multiTestResult' ); dialog.getButton( 'ok' ).click(); - assert.beautified.html( expected, editor.getData() ); + assert.beautified.html( expected, editor.getData(), 'Prevent duplicated anchors failed after editing multiple words with styles' ); } ); }, @@ -125,7 +141,7 @@ dialog.setValueOf( 'info', 'txtName', 'nested' ); dialog.getButton( 'ok' ).click(); - assert.beautified.html( expected, editor.getData() ); + assert.beautified.html( expected, editor.getData(), 'Prevent duplicated anchors failed in the selection: strong > em' ); } ); }, @@ -141,7 +157,7 @@ dialog.setValueOf( 'info', 'txtName', 'emphasize' ); dialog.getButton( 'ok' ).click(); - assert.beautified.html( expected, editor.getData() ); + assert.beautified.html( expected, editor.getData(), 'Prevent duplicated anchors failed in the selection: strong > em > span' ); } ); }, @@ -157,7 +173,7 @@ dialog.setValueOf( 'info', 'txtName', 'multiLine' ); dialog.getButton( 'ok' ).click(); - assert.beautified.html( expected, editor.getData() ); + assert.beautified.html( expected, editor.getData(), 'Prevent duplicated anchors failed in the selection of multiline with styled words' ); } ); }, @@ -173,7 +189,7 @@ dialog.setValueOf( 'info', 'txtName', 'unorderedList' ); dialog.getButton( 'ok' ).click(); - assert.beautified.html( expected, editor.getData() ); + assert.beautified.html( expected, editor.getData(), 'Prevent duplicated anchors failed in the unordered list with styled word' ); } ); }, @@ -189,7 +205,7 @@ dialog.setValueOf( 'info', 'txtName', 'orderedList' ); dialog.getButton( 'ok' ).click(); - assert.beautified.html( expected, editor.getData() ); + assert.beautified.html( expected, editor.getData(), 'Prevent duplicated anchors failed in the ordered list with styled word' ); } ); } } ); diff --git a/tests/plugins/link/manual/anchorcustomstyles.html b/tests/plugins/link/manual/anchorcustomstyles.html deleted file mode 100644 index ee5d729b8e7..00000000000 --- a/tests/plugins/link/manual/anchorcustomstyles.html +++ /dev/null @@ -1,7 +0,0 @@ -
-

Hello world!

-
- - diff --git a/tests/plugins/link/manual/anchorcustomstyles.md b/tests/plugins/link/manual/anchorcustomstyles.md deleted file mode 100644 index 9994f33ebc4..00000000000 --- a/tests/plugins/link/manual/anchorcustomstyles.md +++ /dev/null @@ -1,26 +0,0 @@ -@bender-tags: 4.16.1, bug, link, 4728 -@bender-ui: collapsed -@bender-ckeditor-plugins: link, toolbar, wysiwygarea, basicstyles, sourcearea, clipboard, enterkey, link, list, liststyle, tabletools, tableselection, undo, format, elementspath - -### Scenario 1 -1. Select `world!`. -1. Add an anchor. -1. Edit existing anchor and save it. - -**Expected result:** -There is one anchor with changed `id` and `name`. - -**Unexpected result:** -Anchors was doubled. - -### Scenario 2 -1. Select `world!` and add an anchor. -1. Select `Hello World!` and add an anchor. -1. Edit anchor and save it. - - -**Expected result:** -There is one anchor: `Hello World!`. - -**Unexpected result:** -There are three anchors: One in `Hello` and doubled in `world!`. From 91f6da347b2b989f2e7d25b2275cd72915a9fe93 Mon Sep 17 00:00:00 2001 From: sculpt0r Date: Thu, 22 Jul 2021 15:55:05 +0200 Subject: [PATCH 10/10] Added changelog for duplicated anchors fix [skip ci] --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index e38c2a0b71c..ea97e659be7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,9 @@ CKEditor 4 Changelog ## CKEditor 4.16.2 Fixed Issues: +* [#4733](https://github.com/ckeditor/ckeditor4/pull/4733): Fixed: [Link](https://ckeditor.com/cke4/addon/link) prevent duplicate anchors in text with styles. + * [#4728](https://github.com/ckeditor/ckeditor4/issues/4728): Fixed: Multiple anchors in one line and multi-line with text style. + * [#3863](https://github.com/ckeditor/ckeditor4/issues/3863): Fixed: Multiple anchors in single word with text style. * [#3819](https://github.com/ckeditor/ckeditor4/issues/3819): [Chrome] Fixed: After removing one of the two consecutive spaces, the ` ` character appears in the editor instead of a space. * [#4666](https://github.com/ckeditor/ckeditor4/pull/4666): [IE] Introduce CSS.escape polyfill. Thanks to [limingli0707](https://github.com/limingli0707)! * [#681](https://github.com/ckeditor/ckeditor4/issues/681): Fixed: Table elements (td, tr, th, ..) with an id that starts with dot (.) causes javascript runtime err.