Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Prevent of bolding entire content pasted from google docs #62

Merged
merged 48 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7a296c4
Add function to determines the source app of the data input.
Jul 10, 2019
53152ab
Add test for google docs, fix unit test creator to fully simulate cli…
Jul 15, 2019
ea75c23
Extrct part of the logic to separate files.
Jul 15, 2019
4e21458
Move utils to plugin to provide better way of testing it.
Jul 15, 2019
60a5e53
Add unit test from Firefox source, rename test case, simplify getInpu…
Jul 16, 2019
ac4c635
Unify test suits names.
Jul 16, 2019
f3dbf34
Remove unnecessary autoamtic test which is cover now by filter test.
Jul 16, 2019
1900a9f
Add clipboard input from Firefox which is different from Chrome. Smal…
Jul 16, 2019
529b6e3
Simplify test names.
Jul 16, 2019
f25f38c
Fix bold removal on windows. Add new test cover it. Change tests loca…
Jul 18, 2019
4b05a67
Introduce concept of normalizers.
Jul 19, 2019
d4805f6
Implement normalizers instances for google docs and ms word and extra…
Jul 19, 2019
ca4b62f
Fix automatic test to use clipbaord event instead of run function man…
Jul 22, 2019
ffd320b
Add requires to te plugin.
Jul 22, 2019
f7e6dbd
Provide different test set for paste from office class.
Jul 22, 2019
a6a6ad3
Provide small improvements in normalizer. Add unit test covering norm…
Jul 22, 2019
aa541e4
Add tests for msword normalizer, improve content normalizer class.
Jul 23, 2019
24a349c
Add test for google docs normalizer.
Jul 23, 2019
a907b16
Simplify content normalizers to required functionality.
Jul 23, 2019
7d32bc8
Adapt unit test to new look of contentnormalizer.
Jul 24, 2019
5c925dd
Fix test for specific conten normalizers.
Jul 24, 2019
0017a4b
Remove unnecessary propeties form PFO class.
Jul 24, 2019
318b67c
Docs and small improvment for content noralizer filters.
Jul 24, 2019
0948fc1
Fix docs typos.
Jul 25, 2019
a63bcc1
Apply suggestions from code review
msamsel Jul 25, 2019
751f615
Make interaace from the normalizer. Apply interface to msword and goo…
Jul 26, 2019
c2727b4
Correct folder name with normalizers.
Jul 26, 2019
67d017a
Add unit test to increase coverage to 100.
Jul 26, 2019
e3ae28e
Improve docs.
Jul 26, 2019
f566580
Add missing files.
Jul 26, 2019
df6b1b8
Correct import statements.
Jul 29, 2019
2ae8f69
Rename unit test to match src files.
Jul 29, 2019
ac1c0a1
Update normalizer documentation.
jodator Jul 29, 2019
84762a8
Apply suggestions from code review
msamsel Jul 29, 2019
7eaee98
Change namespace of removeBoldTagWrapper filter.
Jul 29, 2019
219aac7
Improve fitler styling.
Jul 29, 2019
dd1fa0d
Rename exec to execute.
Jul 29, 2019
1b9829c
Rename removeBoldTagWraper to removeBoldWrapper.
Jul 29, 2019
614005a
Fix not renamed exec statement.
Jul 29, 2019
11ae6a1
Fix docs description.
Jul 29, 2019
8bc14fe
Rename normalizer to normalizers namespace.
Jul 29, 2019
201e07c
Unify google docs and ms word normalizers.
Jul 29, 2019
b055de3
Extract regexps matching content source to separate constant variables.
Jul 29, 2019
1bbdbd1
Replace foreach loop with help funciton in pastefromoffice tests.
Jul 29, 2019
a81e493
remove foreach loops in normalizers check.
Jul 29, 2019
a27e2e4
Fix code comments.
Jul 29, 2019
d79a224
Remove leftover, correct namespace.
Jul 29, 2019
ee7e3a0
Split tests into groups, provide helper for each group.
Jul 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/filters/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/**
* @module paste-from-office/filters/common
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is a common filter - so maybe we should just move it to removeboldtagwrapper.js.

*/

/**
* Removes `<b>` tag wrapper added by Google Docs to a copied content.
*
* @param {module:engine/view/documentfragment~DocumentFragment} documentFragment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong parameters in the docs.

*/
export function removeBoldTagWrapper( { documentFragment, writer } ) {
for ( const childWithWrapper of documentFragment.getChildren() ) {
if ( childWithWrapper.is( 'b' ) && childWithWrapper.getStyle( 'font-weight' ) === 'normal' ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

child would be enough - better to read here :)

const childIndex = documentFragment.getChildIndex( childWithWrapper );
const removedElement = writer.remove( childWithWrapper )[ 0 ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd avoid such constructs if possible:

writer.remove( child );

writer.insertChild( index, child.getChildren(), docuemntFragment );

also will work.


writer.insertChild( childIndex, removedElement.getChildren(), documentFragment );
}
}
}
34 changes: 34 additions & 0 deletions src/normalizer.jsdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/**
* @module paste-from-office/normalizer
*/

/**
* Interface defining a content transformation pasted from an external editor.
*
* Normalizers are registered by the {@link module:paste-from-office/pastefromoffice~PasteFromOffice} plugin and run on
* {@link module:clipboard/clipboard~Clipboard#event:inputTransformation inputTransformation event}. They detect environment-specific
* quirks and transform it into a form compatible with other CKEditor features.
*
* @interface Normalizer
*/

/**
* Must return `true` if the `htmlString` contains content which this normalizer can transform.
*
* @method #isActive
* @param {String} htmlString full content of `dataTransfer.getData( 'text/html' )`
* @returns {Boolean}
*/

/**
* Executes the normalization of a given data.
*
* @method #exec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might forgot about it - it should be full form: execute()

* @param {Object} data object obtained from
* {@link module:clipboard/clipboard~Clipboard#event:inputTransformation inputTransformation event}.
*/
37 changes: 37 additions & 0 deletions src/normalizer/googledocsnormalizer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/**
* @module paste-from-office/normalizer/googledocsnormalizer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module path should be normalizers (plural).

*/

import { removeBoldTagWrapper } from '../filters/common';
import UpcastWriter from '@ckeditor/ckeditor5-engine/src/view/upcastwriter';

/**
* Normalizer for the content pasted from Google Docs.
*
* @implements module:paste-from-office/normalizer~Normalizer
*/
export default class GoogleDocsNormalizer {
/**
* @inheritDoc
*/
isActive( htmlString ) {
return /id=("|')docs-internal-guid-[-0-9a-f]+("|')/.test( htmlString );
}

/**
* @inheritDoc
*/
exec( data ) {
const writer = new UpcastWriter();

removeBoldTagWrapper( {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's stick with a similar API as the rest of the filters to have this consistent: removeBoldTagWrapper( documentFragment, writer ).

writer,
documentFragment: data.content
} );
}
}
53 changes: 53 additions & 0 deletions src/normalizer/mswordnormalizer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

/**
* @module paste-from-office/normalizer/mswordnormalizer
*/

import { parseHtml } from '../filters/parse';
import { transformListItemLikeElementsIntoLists } from '../filters/list';
import { replaceImagesSourceWithBase64 } from '../filters/image';

/**
* Normalizer for the content pasted from Microsoft Word.
*
* @implements module:paste-from-office/normalizer~Normalizer
*/
export default class MSWordNormalizer {
/**
* @inheritDoc
*/
isActive( htmlString ) {
return /<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/i.test( htmlString ) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why there are two checks? We can move the RegExps as const out of this method and name them properly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ps.: Also for Google Docs we could move the regexp out of the method.

Copy link
Contributor Author

@msamsel msamsel Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why there are two checks?

Honestly IDK, however, the scope of this PR is related to Google Docs. MS Word is touched only to unify content processing and there is no logic modification. So I would prefer to remain those rules untouched for now.

/xmlns:o="urn:schemas-microsoft-com/i.test( htmlString );
}

/**
* @inheritDoc
*/
exec( data ) {
const html = data.dataTransfer.getData( 'text/html' );

data.content = normalizeWordInput( html, data.dataTransfer );
}
}

//
// Normalizes input pasted from Word to format suitable for editor {@link module:engine/model/model~Model}.
//
// @private
// @param {String} input Word input.
// @param {module:clipboard/datatransfer~DataTransfer} dataTransfer Data transfer instance.
// @returns {module:engine/view/documentfragment~DocumentFragment} Normalized input.
//
function normalizeWordInput( input, dataTransfer ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this method so both normalizers execute() methods will have the same structure.

const { body, stylesString } = parseHtml( input );

transformListItemLikeElementsIntoLists( body, stylesString );
replaceImagesSourceWithBase64( body, dataTransfer.getData( 'text/rtf' ) );

return body;
}
72 changes: 34 additions & 38 deletions src/pastefromoffice.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@

import Plugin from '@ckeditor/ckeditor5-core/src/plugin';

import { parseHtml } from './filters/parse';
import { transformListItemLikeElementsIntoLists } from './filters/list';
import { replaceImagesSourceWithBase64 } from './filters/image';
import GoogleDocsNormalizer from './normalizer/googledocsnormalizer';
import MSWordNormalizer from './normalizer/mswordnormalizer';
import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard';

/**
* The Paste from Office plugin.
*
* This plugin handles content pasted from Office apps (for now only Word) and transforms it (if necessary)
* This plugin handles content pasted from Office apps and transforms it (if necessary)
* to a valid structure which can then be understood by the editor features.
*
* Transformation is made by a set of predefined {@link module:paste-from-office/normalizer~Normalizer normalizers}.
* This plugin includes following normalizers:
* * {@link module:paste-from-office/normalizer/mswordnormalizer~MSWordNormalizer Microsoft Word normalizer}
* * {@link module:paste-from-office/normalizer/googledocsnormalizer~GoogleDocsNormalizer Google Docs normalizer}
*
* For more information about this feature check the {@glink api/paste-from-office package page}.
*
* @extends module:core/plugin~Plugin
Expand All @@ -31,49 +36,40 @@ export default class PasteFromOffice extends Plugin {
return 'PasteFromOffice';
}

/**
* @inheritDoc
*/
static get requires() {
return [ Clipboard ];
}

/**
* @inheritDoc
*/
init() {
const editor = this.editor;
const normalizers = [];

this.listenTo( editor.plugins.get( 'Clipboard' ), 'inputTransformation', ( evt, data ) => {
const html = data.dataTransfer.getData( 'text/html' );
normalizers.push( new MSWordNormalizer() );
normalizers.push( new GoogleDocsNormalizer() );

if ( data.pasteFromOfficeProcessed !== true && isWordInput( html ) ) {
data.content = this._normalizeWordInput( html, data.dataTransfer );
editor.plugins.get( 'Clipboard' ).on(
'inputTransformation',
( evt, data ) => {
if ( data.isTransformedWithPasteFromOffice ) {
return;
}

// Set the flag so if `inputTransformation` is re-fired, PFO will not process it again (#44).
data.pasteFromOfficeProcessed = true;
}
}, { priority: 'high' } );
}

/**
* Normalizes input pasted from Word to format suitable for editor {@link module:engine/model/model~Model}.
*
* **Note**: this function was exposed mainly for testing purposes and should not be called directly.
*
* @protected
* @param {String} input Word input.
* @param {module:clipboard/datatransfer~DataTransfer} dataTransfer Data transfer instance.
* @returns {module:engine/view/documentfragment~DocumentFragment} Normalized input.
*/
_normalizeWordInput( input, dataTransfer ) {
const { body, stylesString } = parseHtml( input );
const htmlString = data.dataTransfer.getData( 'text/html' );
const activeNormalizer = normalizers.find( normalizer => normalizer.isActive( htmlString ) );

transformListItemLikeElementsIntoLists( body, stylesString );
replaceImagesSourceWithBase64( body, dataTransfer.getData( 'text/rtf' ) );
if ( activeNormalizer ) {
activeNormalizer.exec( data );

return body;
data.isTransformedWithPasteFromOffice = true;
}
},
{ priority: 'high' }
);
}
}

// Checks if given HTML string is a result of pasting content from Word.
//
// @param {String} html HTML string to test.
// @returns {Boolean} True if given HTML string is a Word HTML.
function isWordInput( html ) {
return !!( html && ( html.match( /<meta\s*name="?generator"?\s*content="?microsoft\s*word\s*\d+"?\/?>/gi ) ||
html.match( /xmlns:o="urn:schemas-microsoft-com/gi ) ) );
}
51 changes: 51 additions & 0 deletions tests/_data/paste-from-google-docs/bold-wrapper/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

import simpleText from './simple-text/input.html';
import simpleTextWindows from './simple-text-windows/input.html';

import simpleTextNormalized from './simple-text/normalized.html';
import simpleTextWindowsNormalized from './simple-text-windows/normalized.html';

import simpleTextModel from './simple-text/model.html';
import simpleTextWindowsModel from './simple-text-windows/model.html';

export const fixtures = {
input: {
simpleText,
simpleTextWindows
},
normalized: {
simpleText: simpleTextNormalized,
simpleTextWindows: simpleTextWindowsNormalized
},
model: {
simpleText: simpleTextModel,
simpleTextWindows: simpleTextWindowsModel
}
};

import simpleTextFirefox from './simple-text/input.firefox.html';
import simpleTextWindowsFirefox from './simple-text-windows/input.firefox.html';

import simpleTextNormalizedFirefox from './simple-text/normalized.firefox.html';
import simpleTextWindowsNormalizedFirefox from './simple-text-windows/normalized.firefox.html';

export const browserFixtures = {
firefox: {
input: {
simpleText: simpleTextFirefox,
simpleTextWindows: simpleTextWindowsFirefox
},
normalized: {
simpleText: simpleTextNormalizedFirefox,
simpleTextWindows: simpleTextWindowsNormalizedFirefox
},
model: {
simpleText: simpleTextModel,
simpleTextWindows: simpleTextWindowsModel
}
}
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<html><body>
<!--StartFragment--><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" id="docs-internal-guid-f8b26bf1-7fff-40c0-af18-1234567890ab"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Hello world</span></p><!--EndFragment-->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
<!--StartFragment--><b style="font-weight:normal;" id="docs-internal-guid-0954d9f2-7fff-2b3c-4978-1234567890ab"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Hello world</span></p></b><br class="Apple-interchange-newline"><!--EndFragment-->
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<paragraph>Hello world</paragraph>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p dir="ltr" id="docs-internal-guid-f8b26bf1-7fff-40c0-af18-1234567890ab" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:Arial;font-size:11pt;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Hello world</span></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p dir="ltr" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:Arial;font-size:11pt;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Hello world</span></p><br class="Apple-interchange-newline">
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol{margin:0;padding:0}table td,table th{padding:0}.c2{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c1{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c0{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c0"><p class="c1"><span>Hello world</span></p></body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<meta charset="utf-8"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;" id="docs-internal-guid-b205dcb1-7fff-2468-bad5-1234567890ab"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Hello world</span></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<meta charset='utf-8'><meta charset="utf-8"><b style="font-weight:normal;" id="docs-internal-guid-30db46f5-7fff-15a1-e17c-1234567890ab"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Hello world</span></p></b><br class="Apple-interchange-newline">
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<paragraph>Hello world</paragraph>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p dir="ltr" id="docs-internal-guid-b205dcb1-7fff-2468-bad5-1234567890ab" style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:Arial;font-size:11pt;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Hello world</span></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">Hello world</span></p><br class="Apple-interchange-newline">
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol{margin:0;padding:0}table td,table th{padding:0}.c1{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c0{padding-top:0pt;padding-bottom:0pt;line-height:1.15;orphans:2;widows:2;text-align:left}.c2{background-color:#ffffff;max-width:468pt;padding:72pt 72pt 72pt 72pt}.title{padding-top:0pt;color:#000000;font-size:26pt;padding-bottom:3pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}.subtitle{padding-top:0pt;color:#666666;font-size:15pt;padding-bottom:16pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}li{color:#000000;font-size:11pt;font-family:"Arial"}p{margin:0;color:#000000;font-size:11pt;font-family:"Arial"}h1{padding-top:20pt;color:#000000;font-size:20pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h2{padding-top:18pt;color:#000000;font-size:16pt;padding-bottom:6pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h3{padding-top:16pt;color:#434343;font-size:14pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h4{padding-top:14pt;color:#666666;font-size:12pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h5{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;orphans:2;widows:2;text-align:left}h6{padding-top:12pt;color:#666666;font-size:11pt;padding-bottom:4pt;font-family:"Arial";line-height:1.15;page-break-after:avoid;font-style:italic;orphans:2;widows:2;text-align:left}</style></head><body class="c2"><p class="c0"><span class="c1">Hello world</span></p></body></html>
8 changes: 6 additions & 2 deletions tests/_utils/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ import { fixtures as image, browserFixtures as imageBrowser } from '../_data/ima
import { fixtures as link, browserFixtures as linkBrowser } from '../_data/link/index.js';
import { fixtures as list, browserFixtures as listBrowser } from '../_data/list/index.js';
import { fixtures as spacing, browserFixtures as spacingBrowser } from '../_data/spacing/index.js';
import { fixtures as googleDocsBoldWrapper, browserFixtures as googleDocsBoldWrapperBrowser }
from '../_data/paste-from-google-docs/bold-wrapper/index';

// Generic fixtures.
export const fixtures = {
'basic-styles': basicStyles,
image,
link,
list,
spacing
spacing,
'google-docs-bold-wrapper': googleDocsBoldWrapper
};

// Browser specific fixtures.
Expand All @@ -25,5 +28,6 @@ export const browserFixtures = {
image: imageBrowser,
link: linkBrowser,
list: listBrowser,
spacing: spacingBrowser
spacing: spacingBrowser,
'google-docs-bold-wrapper': googleDocsBoldWrapperBrowser
};
Loading