Skip to content

Commit

Permalink
Create config dedicated for PFLO, allow on passing white-space style,…
Browse files Browse the repository at this point in the history
… which appear after pfw transofrmation, fix fixtures for safari.
  • Loading branch information
Mateusz Samsel committed Oct 23, 2019
1 parent 1a55fb6 commit 57d8679
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 27 deletions.
2 changes: 1 addition & 1 deletion plugins/pastefromlibreoffice/filter/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

'p': function( element ) {
element.filterChildren( filter );
Style.createStyleStack( element, filter, editor, /white-space/gi );
Style.createStyleStack( element, filter, editor );
},

'div': function( element ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">Basic inline styles</span>
<span style="white-space:normal">
<span style="text-decoration:none">Basic inline styles</span>
</span>
</span>
</span>
</span>
Expand All @@ -12,7 +14,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none"><strong>bold</strong></span>
<span style="white-space:normal">
<span style="text-decoration:none"><strong>bold</strong></span>
</span>
</span>
</span>
</span>
Expand All @@ -22,7 +26,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none"><em>italic</em></span>
<span style="white-space:normal">
<span style="text-decoration:none"><em>italic</em></span>
</span>
</span>
</span>
</span>
Expand All @@ -32,7 +38,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none"><u>underline</u></span>
<span style="white-space:normal">
<span style="text-decoration:none"><u>underline</u></span>
</span>
</span>
</span>
</span>
Expand All @@ -42,7 +50,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none"><s>strikethrough</s></span>
<span style="white-space:normal">
<span style="text-decoration:none"><s>strikethrough</s></span>
</span>
</span>
</span>
</span>
Expand All @@ -52,7 +62,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none"><sup>superscript</sup></span>
<span style="white-space:normal">
<span style="text-decoration:none"><sup>superscript</sup></span>
</span>
</span>
</span>
</span>
Expand All @@ -62,7 +74,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none"><sub>subscript</sub></span>
<span style="white-space:normal">
<span style="text-decoration:none"><sub>subscript</sub></span>
</span>
</span>
</span>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">Different font sizes: <span style="font-size:6pt">6</span>, <span style="font-size:8pt">8</span>, <span style="font-size:10pt">10</span>, 12, <span style="font-size:16pt">16</span>, <span style="font-size:24pt">24</span>, <span style="font-size:32pt">32</span>, <span style="font-size:48pt">48</span>, <span style="font-size:80pt">80</span></span>
<span style="white-space:normal">
<span style="text-decoration:none">Different font sizes: <span style="font-size:6pt">6</span>, <span style="font-size:8pt">8</span>, <span style="font-size:10pt">10</span>, 12, <span style="font-size:16pt">16</span>, <span style="font-size:24pt">24</span>, <span style="font-size:32pt">32</span>, <span style="font-size:48pt">48</span>, <span style="font-size:80pt">80</span></span>
</span>
</span>
</span>
</span>
Expand All @@ -15,7 +17,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">Different font face: <span style="font-family:Courier New,monospace">Courier New</span>, <span style="font-family:Verdana,sans-serif">Verdana</span>, <span style="font-family:Times New Roman,serif">Times New Roman</span>, <span style="font-family:Arial,sans-serif">Arial</span>.</span>
<span style="white-space:normal">
<span style="text-decoration:none">Different font face: <span style="font-family:Courier New,monospace">Courier New</span>, <span style="font-family:Verdana,sans-serif">Verdana</span>, <span style="font-family:Times New Roman,serif">Times New Roman</span>, <span style="font-family:Arial,sans-serif">Arial</span>.</span>
</span>
</span>
</span>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">
<span style="background-color:#6b5e9b">Background color</span>
<span style="white-space:normal">
<span style="text-decoration:none">
<span style="background-color:#6b5e9b">Background color</span>
</span>
</span>
</span>
</span>
Expand All @@ -16,8 +18,10 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">
<span style="color:#127622">Font color</span>
<span style="white-space:normal">
<span style="text-decoration:none">
<span style="color:#127622">Font color</span>
</span>
</span>
</span>
</span>
Expand All @@ -29,9 +33,11 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">
<span style="color:#ffff38">
<span style="background-color:#468a1a">Mixed background and font color</span>
<span style="white-space:normal">
<span style="text-decoration:none">
<span style="color:#ffff38">
<span style="background-color:#468a1a">Mixed background and font color</span>
</span>
</span>
</span>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">Simple text <a data-cke-saved-href="http://example.com/" href="http://example.com/">link</a>.</span>
<span style="white-space:normal">
<span style="text-decoration:none">Simple text <a data-cke-saved-href="http://example.com/" href="http://example.com/">link</a>.</span>
</span>
</span>
</span>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">Ordered list:</span>
<span style="white-space:normal">
<span style="text-decoration:none">Ordered list:</span>
</span>
</span>
</span>
</span>
Expand Down Expand Up @@ -81,7 +83,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">Unordered list:</span>
<span style="white-space:normal">
<span style="text-decoration:none">Unordered list:</span>
</span>
</span>
</span>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<span style="color:#000000">
<span style="font-style:normal">
<span style="font-weight:normal">
<span style="text-decoration:none">Simple text</span>
<span style="white-space:normal">
<span style="text-decoration:none">Simple text</span>
</span>
</span>
</span>
</span>
Expand Down
12 changes: 12 additions & 0 deletions tests/plugins/pastefromlibreoffice/generated/_helpers/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* exported pfloConfig */

( function() {
'use strict';

window.pfloConfig = {
language: 'en',
removePlugins: 'dialogadvtab,flash,showborders,horizontalrule',
extraAllowedContent: 'span{line-height,font-weight,font-style,text-decoration,text-underline,display,white-space,' +
'height,text-justify,direction,dir,lang,page-break-after};td[valign]'
};
} )();
6 changes: 3 additions & 3 deletions tests/plugins/pastefromlibreoffice/generated/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
/* jshint ignore:end */
/* bender-include: ../../pastefromword/generated/_helpers/promisePasteEvent.js,../../pastefromword/generated/_helpers/assertWordFilter.js */
/* bender-include: ../../pastefromword/generated/_helpers/createTestCase.js,../../pastefromword/generated/_helpers/createTestSuite.js */
/* bender-include: ../../pastefromword/generated/_helpers/pfwTools.js */
/* global pfwTools,createTestSuite */
/* bender-include: ./_helpers/config.js */
/* global pfloConfig,createTestSuite */

( function() {
'use strict';

bender.editor = {
config: pfwTools.defaultConfig
config: pfloConfig
};

bender.test( createTestSuite( {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
/* jshint ignore:end */
/* bender-include: ../../pastefromword/generated/_helpers/promisePasteEvent.js,../../pastefromword/generated/_helpers/assertWordFilter.js */
/* bender-include: ../../pastefromword/generated/_helpers/createTestCase.js,../../pastefromword/generated/_helpers/createTestSuite.js */
/* bender-include: ../../pastefromword/generated/_helpers/pfwTools.js */
/* global pfwTools,createTestSuite */
/* bender-include: ./_helpers/config.js */
/* global pfloConfig,createTestSuite */

( function() {
'use strict';

bender.editor = {
config: pfwTools.defaultConfig
config: pfloConfig
};

bender.test( createTestSuite( {
Expand Down

0 comments on commit 57d8679

Please sign in to comment.