From ccea86f984a4bcaa75b21db3851556ce17affc8a Mon Sep 17 00:00:00 2001 From: Mateusz Samsel Date: Tue, 12 Sep 2017 14:17:34 +0200 Subject: [PATCH 1/6] Unit tests. --- .../Unordered_list_special_char_bullet.docx | Bin 0 -> 13355 bytes .../expected.html | 27 + .../word2013/chrome.html | 916 ++++++++++++++++++ .../word2013/expected_ie11.html | 33 + .../word2013/firefox.html | 916 ++++++++++++++++++ .../word2013/ie11.html | 10 + .../pastefromword/generated/generic.js | 1 + 7 files changed, 1903 insertions(+) create mode 100644 tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/Unordered_list_special_char_bullet.docx create mode 100644 tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/expected.html create mode 100644 tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/chrome.html create mode 100644 tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/expected_ie11.html create mode 100644 tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/firefox.html create mode 100644 tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/ie11.html diff --git a/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/Unordered_list_special_char_bullet.docx b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/Unordered_list_special_char_bullet.docx new file mode 100644 index 0000000000000000000000000000000000000000..6605e78bc279ae58901848513ed00d9974b0e0e3 GIT binary patch literal 13355 zcmeHu1zTLn^7r6Qa3{FCLxQ^oCpbZaySoQ>XK;6i;4VReI|K{C-Tgn=y?b{zci;C5 z+muexTYs=B(Xj)DvXBnAK)01E&BNC2#{Ht$Wq0DuB00012T3$7(%W9?{c z?Wm{XW^3%A!{};dNt_D_PMr+^2lfBo@n8H4)F+IX_cEi1-2^=cOg1h^w@?@KeaVeB z#y7nO3uAvLdL^9K_S~_>%~C+l!v1A|cznfU9F`?uaw*Lc4z}~D1vYcS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^VX*ks?7ZrxGVnFl4jnrvw}(vj3t$N$_N1v|F(p}b znjv@=Im%UeYl_o=WiM^K%viSxdkA|?XnEBP-%q#*sHUhsA5cXV#eP;sw zx4%~df`K!DvSI)HRKy<|@W{k}QmK6NS0uD5_{l?<2 z1qQ#ue@#^W2|ovwz5NFNC2jdDhhOt`e{x{J{zHI&XYYOm|9$7+PbdJeP6`10$3DWZ z@Lv~le=>-n_}AEfTh{%G|1}W!3!d&@_`ih(zvBPy*8fBU0N{*&5&vIKUO@&5q+S33 PBIpGM(ohVRpLhQU9)}vt literal 0 HcmV?d00001 diff --git a/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/expected.html b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/expected.html new file mode 100644 index 00000000000..d34ecdb1e4e --- /dev/null +++ b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/expected.html @@ -0,0 +1,27 @@ +
    +
  • + + + one + + +
      +
    • + + + two + + +
        +
      • + + + three + + +
      • +
      +
    • +
    +
  • +
diff --git a/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/chrome.html b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/chrome.html new file mode 100644 index 00000000000..a296a2aec58 --- /dev/null +++ b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/chrome.html @@ -0,0 +1,916 @@ + + + + + + + + + + + + + + + + + + + +

*      +One

+ +

+     +Two

+ +

?      +Three

+ + + + + diff --git a/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/expected_ie11.html b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/expected_ie11.html new file mode 100644 index 00000000000..f489790ae45 --- /dev/null +++ b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/expected_ie11.html @@ -0,0 +1,33 @@ +
    +
  • + + one + +
      +
    • + + + + + two + + + + +
        +
      • + + + + + three + + + + +
      • +
      +
    • +
    +
  • +
diff --git a/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/firefox.html b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/firefox.html new file mode 100644 index 00000000000..a296a2aec58 --- /dev/null +++ b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/firefox.html @@ -0,0 +1,916 @@ + + + + + + + + + + + + + + + + + + + +

*      +One

+ +

+     +Two

+ +

?      +Three

+ + + + + diff --git a/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/ie11.html b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/ie11.html new file mode 100644 index 00000000000..0950599927a --- /dev/null +++ b/tests/plugins/pastefromword/generated/_fixtures/Unordered_list_special_char_bullet/word2013/ie11.html @@ -0,0 +1,10 @@ + + + +
  • One

    • Two

      • Three

+ + + + + + diff --git a/tests/plugins/pastefromword/generated/generic.js b/tests/plugins/pastefromword/generated/generic.js index a5996dca024..a60fc0d000c 100644 --- a/tests/plugins/pastefromword/generated/generic.js +++ b/tests/plugins/pastefromword/generated/generic.js @@ -46,6 +46,7 @@ 'Text_alignment': true, 'Underline': true, 'Unordered_list': true, + 'Unordered_list_special_char_bullet': true, 'Table_alignment': true, 'Table_vertical_alignment': true }, From 74f48f3cfdb32483608c6bc2f62002f37e141abb Mon Sep 17 00:00:00 2001 From: Mateusz Samsel Date: Wed, 13 Sep 2017 11:17:34 +0200 Subject: [PATCH 2/6] Manual test. --- .../manual/unorderedlistspecialchar.html | 4 ++++ .../manual/unorderedlistspecialchar.md | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/plugins/pastefromword/manual/unorderedlistspecialchar.html create mode 100644 tests/plugins/pastefromword/manual/unorderedlistspecialchar.md diff --git a/tests/plugins/pastefromword/manual/unorderedlistspecialchar.html b/tests/plugins/pastefromword/manual/unorderedlistspecialchar.html new file mode 100644 index 00000000000..cde2278b009 --- /dev/null +++ b/tests/plugins/pastefromword/manual/unorderedlistspecialchar.html @@ -0,0 +1,4 @@ + + diff --git a/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md b/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md new file mode 100644 index 00000000000..9d9614ebbd6 --- /dev/null +++ b/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md @@ -0,0 +1,16 @@ +@bender-tags: bug, 4.8.0, 877, pastefromword +@bender-ui: collapsed +@bender-ckeditor-plugins: wysiwygarea, toolbar, undo, pastefromword, sourcearea, list + +---- +1. Open browser console. +1. Open [file](../generated/_fixtures/Unordered_list_special_char_bullet/Unordered_list_special_char_bullet.docx) in Word. +1. Select whole content in Word and copy it to clipboard. +1. Focus CKEditor. +1. Paste word content to editor. + +### Expected +List is pasted to the editor. + +### Unexpected +Error appears in console and list is not pasted to the editor. From a757dbe16b14108339390a94d72d8abfad877d3d Mon Sep 17 00:00:00 2001 From: Mateusz Samsel Date: Tue, 12 Sep 2017 13:53:49 +0200 Subject: [PATCH 3/6] Fix problem with astriks symbol as bulleted list in paste from word. --- plugins/pastefromword/filter/default.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/pastefromword/filter/default.js b/plugins/pastefromword/filter/default.js index 0098728ff7e..e00384a7891 100644 --- a/plugins/pastefromword/filter/default.js +++ b/plugins/pastefromword/filter/default.js @@ -1085,7 +1085,8 @@ symbol = element.attributes[ 'cke-symbol' ]; element.forEach( function( node ) { - if ( !removed && node.value.match( symbol.replace( ')', '\\)' ).replace( '(', '' ) ) ) { + // Changing `match` -> `indexOf`, symbol is String not RegExp (#877). + if ( !removed && node.value.indexOf( symbol ) > -1 ) { node.value = node.value.replace( symbol, '' ); From 0efa05dc15a6c5f5f5344b53eb630815827d4f1c Mon Sep 17 00:00:00 2001 From: Mateusz Samsel Date: Wed, 4 Oct 2017 13:14:22 +0200 Subject: [PATCH 4/6] Review: ignore tests on edge, reword comment, fix manual test description. --- plugins/pastefromword/filter/default.js | 2 +- tests/plugins/pastefromword/generated/generic.js | 4 +++- .../plugins/pastefromword/manual/unorderedlistspecialchar.md | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/pastefromword/filter/default.js b/plugins/pastefromword/filter/default.js index e00384a7891..2f667145bb4 100644 --- a/plugins/pastefromword/filter/default.js +++ b/plugins/pastefromword/filter/default.js @@ -1085,7 +1085,7 @@ symbol = element.attributes[ 'cke-symbol' ]; element.forEach( function( node ) { - // Changing `match` -> `indexOf`, symbol is String not RegExp (#877). + // Since symbol may contains special characters we use simple indexOf instead of RegExp which is sufficient (#877). if ( !removed && node.value.indexOf( symbol ) > -1 ) { node.value = node.value.replace( symbol, '' ); diff --git a/tests/plugins/pastefromword/generated/generic.js b/tests/plugins/pastefromword/generated/generic.js index a60fc0d000c..376c97d2907 100644 --- a/tests/plugins/pastefromword/generated/generic.js +++ b/tests/plugins/pastefromword/generated/generic.js @@ -53,7 +53,9 @@ testData: { _should: { ignore: { - 'test Object word2013 datatransfer': CKEDITOR.env.edge + 'test Object word2013 datatransfer': CKEDITOR.env.edge, + 'test Unordered_list_special_char_bullet word2013 chrome': CKEDITOR.env.edge, + 'test Unordered_list_special_char_bullet word2013 firefox': CKEDITOR.env.edge } } }, diff --git a/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md b/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md index 9d9614ebbd6..8f15f11b673 100644 --- a/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md +++ b/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md @@ -4,7 +4,7 @@ ---- 1. Open browser console. -1. Open [file](../generated/_fixtures/Unordered_list_special_char_bullet/Unordered_list_special_char_bullet.docx) in Word. +1. Open [Unordered_list_special_char_bullet.docx](../generated/_fixtures/Unordered_list_special_char_bullet/Unordered_list_special_char_bullet.docx) in Word. 1. Select whole content in Word and copy it to clipboard. 1. Focus CKEditor. 1. Paste word content to editor. From 36ec52ef45a9ce2a6118740478182dabdcfa532d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Krzto=C5=84?= Date: Fri, 6 Oct 2017 11:27:58 +0200 Subject: [PATCH 5/6] Rewording. --- plugins/pastefromword/filter/default.js | 2 +- .../pastefromword/manual/unorderedlistspecialchar.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/pastefromword/filter/default.js b/plugins/pastefromword/filter/default.js index 2f667145bb4..05572c596c0 100644 --- a/plugins/pastefromword/filter/default.js +++ b/plugins/pastefromword/filter/default.js @@ -1085,7 +1085,7 @@ symbol = element.attributes[ 'cke-symbol' ]; element.forEach( function( node ) { - // Since symbol may contains special characters we use simple indexOf instead of RegExp which is sufficient (#877). + // Since symbol may contains special characters we use `indexOf` (instead of RegExp) which is sufficient (#877). if ( !removed && node.value.indexOf( symbol ) > -1 ) { node.value = node.value.replace( symbol, '' ); diff --git a/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md b/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md index 8f15f11b673..91dc916ee8d 100644 --- a/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md +++ b/tests/plugins/pastefromword/manual/unorderedlistspecialchar.md @@ -5,12 +5,12 @@ ---- 1. Open browser console. 1. Open [Unordered_list_special_char_bullet.docx](../generated/_fixtures/Unordered_list_special_char_bullet/Unordered_list_special_char_bullet.docx) in Word. -1. Select whole content in Word and copy it to clipboard. +1. Select and copy whole content from Word. 1. Focus CKEditor. -1. Paste word content to editor. +1. Paste copied Word content into the editor. ### Expected List is pasted to the editor. ### Unexpected -Error appears in console and list is not pasted to the editor. +Error appears in browser console and list is not pasted to the editor. From dfea9ba82ab69c7dfe31c627e46c9cd9f5854448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Krzto=C5=84?= Date: Fri, 6 Oct 2017 11:45:55 +0200 Subject: [PATCH 6/6] Changelog entry. [skip ci] --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 53a3ec5685a..42729e416ce 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ Fixed Issues: * [#862](https://github.com/ckeditor/ckeditor-dev/issues/862): Fixed: "Object Styles" group in [Styles Combo](https://ckeditor.com/addon/stylescombo) plugin is visible only if whole element is selected. * [#994](https://github.com/ckeditor/ckeditor-dev/pull/994): Fixed: Typo in [`CKEDITOR.focusManager.focus`](https://docs.ckeditor.com/#!/api/CKEDITOR.focusManager-method-focus) API documentation. Thanks to [benjy](https://github.com/benjy)! * [#1014](https://github.com/ckeditor/ckeditor-dev/issues/1014): Fixed: [Table Tools](https://ckeditor.com/addon/tabletools) cell properties dialog is now [ACF](http://docs.ckeditor.com/#!/guide/dev_acf) aware - it not possible to change cell width/height if corresponding styles are disabled. +* [#877](https://github.com/ckeditor/ckeditor-dev/issues/877): Fixed: Lists with custom bullets with exotic characters crashes editor when [pasted from Word](http://ckeditor.com/addon/pastefromword). Other Changes: