From faa5e157423f7c5ca124cdbb89fedce45332a9aa Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 11 Jul 2018 10:38:36 -0400 Subject: [PATCH 1/2] Serializer: Remove HTML beautification, preserve whitespace --- blocks/api/serializer.js | 19 +---- blocks/api/test/serializer.js | 9 -- .../core-embed__animoto.serialized.html | 5 +- .../core-embed__cloudup.serialized.html | 5 +- .../core-embed__collegehumor.serialized.html | 5 +- .../core-embed__dailymotion.serialized.html | 5 +- .../core-embed__facebook.serialized.html | 5 +- .../core-embed__flickr.serialized.html | 5 +- .../core-embed__funnyordie.serialized.html | 5 +- .../fixtures/core-embed__hulu.serialized.html | 5 +- .../core-embed__imgur.serialized.html | 5 +- .../core-embed__instagram.serialized.html | 5 +- .../core-embed__issuu.serialized.html | 5 +- .../core-embed__kickstarter.serialized.html | 5 +- .../core-embed__meetup-com.serialized.html | 5 +- .../core-embed__mixcloud.serialized.html | 5 +- .../core-embed__photobucket.serialized.html | 5 +- .../core-embed__polldaddy.serialized.html | 5 +- .../core-embed__reddit.serialized.html | 5 +- .../core-embed__reverbnation.serialized.html | 5 +- .../core-embed__screencast.serialized.html | 5 +- .../core-embed__scribd.serialized.html | 5 +- .../core-embed__slideshare.serialized.html | 5 +- .../core-embed__smugmug.serialized.html | 5 +- .../core-embed__soundcloud.serialized.html | 5 +- .../core-embed__speaker.serialized.html | 5 +- .../core-embed__spotify.serialized.html | 5 +- .../fixtures/core-embed__ted.serialized.html | 5 +- .../core-embed__tumblr.serialized.html | 5 +- .../core-embed__twitter.serialized.html | 5 +- .../core-embed__videopress.serialized.html | 5 +- .../core-embed__vimeo.serialized.html | 5 +- .../core-embed__wordpress-tv.serialized.html | 5 +- .../core-embed__wordpress.serialized.html | 5 +- .../core-embed__youtube.serialized.html | 5 +- .../fixtures/core__column.serialized.html | 14 ++-- .../fixtures/core__columns.serialized.html | 38 ++++----- .../core__cover-image.serialized.html | 4 +- .../test/fixtures/core__embed.serialized.html | 5 +- .../fixtures/core__gallery.serialized.html | 9 +- .../core__gallery__columns.serialized.html | 9 +- .../test/fixtures/core__image.serialized.html | 2 +- ...ore__image__center-caption.serialized.html | 4 +- .../fixtures/core__list__ul.serialized.html | 9 +- .../fixtures/core__pullquote.serialized.html | 3 +- ...pullquote__multi-paragraph.serialized.html | 4 +- .../core__quote__style-1.serialized.html | 3 +- .../core__quote__style-2.serialized.html | 3 +- .../fixtures/core__separator.serialized.html | 2 +- .../test/fixtures/core__table.serialized.html | 47 +---------- .../core__text-columns.serialized.html | 9 +- ...ext__converts-to-paragraph.serialized.html | 2 +- .../test/__snapshots__/index.js.snap | 8 +- package-lock.json | 57 ++++--------- package.json | 1 - .../__snapshots__/adding-blocks.test.js.snap | 14 +--- .../style-variation.test.js.snap | 4 +- .../__snapshots__/templates.test.js.snap | 28 +++---- .../__snapshots__/writing-flow.test.js.snap | 26 +++--- test/e2e/specs/adding-inline-tokens.test.js | 2 +- test/integration/blocks-raw-handling.spec.js | 2 +- test/integration/fixtures/apple-out.html | 72 +++++----------- test/integration/fixtures/classic-out.html | 2 +- test/integration/fixtures/evernote-out.html | 55 +++---------- .../integration/fixtures/google-docs-out.html | 40 ++------- test/integration/fixtures/markdown-out.html | 43 ++-------- .../fixtures/ms-word-online-out.html | 35 +------- test/integration/fixtures/ms-word-out.html | 82 ++++++------------- test/integration/fixtures/one-image-out.html | 2 +- test/integration/fixtures/two-images-out.html | 4 +- test/integration/fixtures/wordpress-out.html | 6 +- 71 files changed, 231 insertions(+), 612 deletions(-) diff --git a/blocks/api/serializer.js b/blocks/api/serializer.js index cb44083495f11c..d68a1a495446fe 100644 --- a/blocks/api/serializer.js +++ b/blocks/api/serializer.js @@ -2,7 +2,6 @@ * External dependencies */ import { isEmpty, reduce, isObject, castArray, startsWith } from 'lodash'; -import { html as beautifyHtml } from 'js-beautify'; /** * WordPress dependencies @@ -189,22 +188,6 @@ export function serializeAttributes( attributes ) { .replace( /\\"/g, '\\u0022' ); } -/** - * Returns HTML markup processed by a markup beautifier configured for use in - * block serialization. - * - * @param {string} content Original HTML. - * - * @return {string} Beautiful HTML. - */ -export function getBeautifulContent( content ) { - return beautifyHtml( content, { - indent_inner_html: true, - indent_with_tabs: true, - wrap_line_length: 0, - } ); -} - /** * Given a block object, returns the Block's Inner HTML markup. * @@ -228,7 +211,7 @@ export function getBlockContent( block ) { } catch ( error ) {} } - return getUnknownTypeHandlerName() === block.name || ! saveContent ? saveContent : getBeautifulContent( saveContent ); + return saveContent; } /** diff --git a/blocks/api/test/serializer.js b/blocks/api/test/serializer.js index 8d14dfafa98d5a..09af0f11f7a6b5 100644 --- a/blocks/api/test/serializer.js +++ b/blocks/api/test/serializer.js @@ -8,7 +8,6 @@ import { createElement, Component } from '@wordpress/element'; */ import serialize, { getCommentAttributes, - getBeautifulContent, getSaveContent, serializeAttributes, getCommentDelimitedContent, @@ -36,14 +35,6 @@ describe( 'block serializer', () => { } ); } ); - describe( 'getBeautifulContent()', () => { - it( 'returns beautiful content', () => { - const content = getBeautifulContent( '
Beautiful
' ); - - expect( content ).toBe( '
\n\t
Beautiful
\n
' ); - } ); - } ); - describe( 'getSaveContent()', () => { describe( 'function save', () => { it( 'should return element as string if save returns element', () => { diff --git a/core-blocks/test/fixtures/core-embed__animoto.serialized.html b/core-blocks/test/fixtures/core-embed__animoto.serialized.html index a373ec7920f3b3..4223a952f7bd05 100644 --- a/core-blocks/test/fixtures/core-embed__animoto.serialized.html +++ b/core-blocks/test/fixtures/core-embed__animoto.serialized.html @@ -1,6 +1,5 @@
- https://animoto.com/ -
Embedded content from animoto
-
+https://animoto.com/ +
Embedded content from animoto
diff --git a/core-blocks/test/fixtures/core-embed__cloudup.serialized.html b/core-blocks/test/fixtures/core-embed__cloudup.serialized.html index a412feb179d5d4..da39bd3df14fc5 100644 --- a/core-blocks/test/fixtures/core-embed__cloudup.serialized.html +++ b/core-blocks/test/fixtures/core-embed__cloudup.serialized.html @@ -1,6 +1,5 @@
- https://cloudup.com/ -
Embedded content from cloudup
-
+https://cloudup.com/ +
Embedded content from cloudup
diff --git a/core-blocks/test/fixtures/core-embed__collegehumor.serialized.html b/core-blocks/test/fixtures/core-embed__collegehumor.serialized.html index 7fed839958f590..f2a94f474ff738 100644 --- a/core-blocks/test/fixtures/core-embed__collegehumor.serialized.html +++ b/core-blocks/test/fixtures/core-embed__collegehumor.serialized.html @@ -1,6 +1,5 @@
- https://collegehumor.com/ -
Embedded content from collegehumor
-
+https://collegehumor.com/ +
Embedded content from collegehumor
diff --git a/core-blocks/test/fixtures/core-embed__dailymotion.serialized.html b/core-blocks/test/fixtures/core-embed__dailymotion.serialized.html index b992a49354404a..5505e92560ed91 100644 --- a/core-blocks/test/fixtures/core-embed__dailymotion.serialized.html +++ b/core-blocks/test/fixtures/core-embed__dailymotion.serialized.html @@ -1,6 +1,5 @@
- https://dailymotion.com/ -
Embedded content from dailymotion
-
+https://dailymotion.com/ +
Embedded content from dailymotion
diff --git a/core-blocks/test/fixtures/core-embed__facebook.serialized.html b/core-blocks/test/fixtures/core-embed__facebook.serialized.html index 1f8111994f94dc..8581e135ed43fc 100644 --- a/core-blocks/test/fixtures/core-embed__facebook.serialized.html +++ b/core-blocks/test/fixtures/core-embed__facebook.serialized.html @@ -1,6 +1,5 @@
- https://facebook.com/ -
Embedded content from facebook
-
+https://facebook.com/ +
Embedded content from facebook
diff --git a/core-blocks/test/fixtures/core-embed__flickr.serialized.html b/core-blocks/test/fixtures/core-embed__flickr.serialized.html index 9584977e8c0917..a26a2470c38142 100644 --- a/core-blocks/test/fixtures/core-embed__flickr.serialized.html +++ b/core-blocks/test/fixtures/core-embed__flickr.serialized.html @@ -1,6 +1,5 @@
- https://flickr.com/ -
Embedded content from flickr
-
+https://flickr.com/ +
Embedded content from flickr
diff --git a/core-blocks/test/fixtures/core-embed__funnyordie.serialized.html b/core-blocks/test/fixtures/core-embed__funnyordie.serialized.html index 821e1d3dda1372..c4d456cc7724bf 100644 --- a/core-blocks/test/fixtures/core-embed__funnyordie.serialized.html +++ b/core-blocks/test/fixtures/core-embed__funnyordie.serialized.html @@ -1,6 +1,5 @@
- https://funnyordie.com/ -
Embedded content from funnyordie
-
+https://funnyordie.com/ +
Embedded content from funnyordie
diff --git a/core-blocks/test/fixtures/core-embed__hulu.serialized.html b/core-blocks/test/fixtures/core-embed__hulu.serialized.html index 69cc7472071ad3..2282e9a67ce9ad 100644 --- a/core-blocks/test/fixtures/core-embed__hulu.serialized.html +++ b/core-blocks/test/fixtures/core-embed__hulu.serialized.html @@ -1,6 +1,5 @@
- https://hulu.com/ -
Embedded content from hulu
-
+https://hulu.com/ +
Embedded content from hulu
diff --git a/core-blocks/test/fixtures/core-embed__imgur.serialized.html b/core-blocks/test/fixtures/core-embed__imgur.serialized.html index f5610aac771d7c..9dc9735f82dd93 100644 --- a/core-blocks/test/fixtures/core-embed__imgur.serialized.html +++ b/core-blocks/test/fixtures/core-embed__imgur.serialized.html @@ -1,6 +1,5 @@
- https://imgur.com/ -
Embedded content from imgur
-
+https://imgur.com/ +
Embedded content from imgur
diff --git a/core-blocks/test/fixtures/core-embed__instagram.serialized.html b/core-blocks/test/fixtures/core-embed__instagram.serialized.html index 75d6dfd0884af9..233545735cab50 100644 --- a/core-blocks/test/fixtures/core-embed__instagram.serialized.html +++ b/core-blocks/test/fixtures/core-embed__instagram.serialized.html @@ -1,6 +1,5 @@
- https://instagram.com/ -
Embedded content from instagram
-
+https://instagram.com/ +
Embedded content from instagram
diff --git a/core-blocks/test/fixtures/core-embed__issuu.serialized.html b/core-blocks/test/fixtures/core-embed__issuu.serialized.html index e1d81bfa085964..c2f5c5d8c7eca5 100644 --- a/core-blocks/test/fixtures/core-embed__issuu.serialized.html +++ b/core-blocks/test/fixtures/core-embed__issuu.serialized.html @@ -1,6 +1,5 @@
- https://issuu.com/ -
Embedded content from issuu
-
+https://issuu.com/ +
Embedded content from issuu
diff --git a/core-blocks/test/fixtures/core-embed__kickstarter.serialized.html b/core-blocks/test/fixtures/core-embed__kickstarter.serialized.html index 34a1bd315b9627..84d30ed20c53a2 100644 --- a/core-blocks/test/fixtures/core-embed__kickstarter.serialized.html +++ b/core-blocks/test/fixtures/core-embed__kickstarter.serialized.html @@ -1,6 +1,5 @@
- https://kickstarter.com/ -
Embedded content from kickstarter
-
+https://kickstarter.com/ +
Embedded content from kickstarter
diff --git a/core-blocks/test/fixtures/core-embed__meetup-com.serialized.html b/core-blocks/test/fixtures/core-embed__meetup-com.serialized.html index dc4f231cf7c673..816266468309eb 100644 --- a/core-blocks/test/fixtures/core-embed__meetup-com.serialized.html +++ b/core-blocks/test/fixtures/core-embed__meetup-com.serialized.html @@ -1,6 +1,5 @@
- https://meetup.com/ -
Embedded content from meetup-com
-
+https://meetup.com/ +
Embedded content from meetup-com
diff --git a/core-blocks/test/fixtures/core-embed__mixcloud.serialized.html b/core-blocks/test/fixtures/core-embed__mixcloud.serialized.html index b0e4c078bed716..ef7b448ccbc100 100644 --- a/core-blocks/test/fixtures/core-embed__mixcloud.serialized.html +++ b/core-blocks/test/fixtures/core-embed__mixcloud.serialized.html @@ -1,6 +1,5 @@
- https://mixcloud.com/ -
Embedded content from mixcloud
-
+https://mixcloud.com/ +
Embedded content from mixcloud
diff --git a/core-blocks/test/fixtures/core-embed__photobucket.serialized.html b/core-blocks/test/fixtures/core-embed__photobucket.serialized.html index 08d61242ac40ca..a9240a7c8b291d 100644 --- a/core-blocks/test/fixtures/core-embed__photobucket.serialized.html +++ b/core-blocks/test/fixtures/core-embed__photobucket.serialized.html @@ -1,6 +1,5 @@
- https://photobucket.com/ -
Embedded content from photobucket
-
+https://photobucket.com/ +
Embedded content from photobucket
diff --git a/core-blocks/test/fixtures/core-embed__polldaddy.serialized.html b/core-blocks/test/fixtures/core-embed__polldaddy.serialized.html index f5f553a26363aa..34155ee1ff48b7 100644 --- a/core-blocks/test/fixtures/core-embed__polldaddy.serialized.html +++ b/core-blocks/test/fixtures/core-embed__polldaddy.serialized.html @@ -1,6 +1,5 @@
- https://polldaddy.com/ -
Embedded content from polldaddy
-
+https://polldaddy.com/ +
Embedded content from polldaddy
diff --git a/core-blocks/test/fixtures/core-embed__reddit.serialized.html b/core-blocks/test/fixtures/core-embed__reddit.serialized.html index be1f560bae3028..6f06579b5ea97e 100644 --- a/core-blocks/test/fixtures/core-embed__reddit.serialized.html +++ b/core-blocks/test/fixtures/core-embed__reddit.serialized.html @@ -1,6 +1,5 @@
- https://reddit.com/ -
Embedded content from reddit
-
+https://reddit.com/ +
Embedded content from reddit
diff --git a/core-blocks/test/fixtures/core-embed__reverbnation.serialized.html b/core-blocks/test/fixtures/core-embed__reverbnation.serialized.html index 14e05150f3f248..54eb9d20bfc6bf 100644 --- a/core-blocks/test/fixtures/core-embed__reverbnation.serialized.html +++ b/core-blocks/test/fixtures/core-embed__reverbnation.serialized.html @@ -1,6 +1,5 @@
- https://reverbnation.com/ -
Embedded content from reverbnation
-
+https://reverbnation.com/ +
Embedded content from reverbnation
diff --git a/core-blocks/test/fixtures/core-embed__screencast.serialized.html b/core-blocks/test/fixtures/core-embed__screencast.serialized.html index 2bad4b6217a44e..1655e2089c4412 100644 --- a/core-blocks/test/fixtures/core-embed__screencast.serialized.html +++ b/core-blocks/test/fixtures/core-embed__screencast.serialized.html @@ -1,6 +1,5 @@
- https://screencast.com/ -
Embedded content from screencast
-
+https://screencast.com/ +
Embedded content from screencast
diff --git a/core-blocks/test/fixtures/core-embed__scribd.serialized.html b/core-blocks/test/fixtures/core-embed__scribd.serialized.html index c4d100232bfc49..2e899ac017740c 100644 --- a/core-blocks/test/fixtures/core-embed__scribd.serialized.html +++ b/core-blocks/test/fixtures/core-embed__scribd.serialized.html @@ -1,6 +1,5 @@
- https://scribd.com/ -
Embedded content from scribd
-
+https://scribd.com/ +
Embedded content from scribd
diff --git a/core-blocks/test/fixtures/core-embed__slideshare.serialized.html b/core-blocks/test/fixtures/core-embed__slideshare.serialized.html index d87730ee1cb608..9af4710cba45de 100644 --- a/core-blocks/test/fixtures/core-embed__slideshare.serialized.html +++ b/core-blocks/test/fixtures/core-embed__slideshare.serialized.html @@ -1,6 +1,5 @@
- https://slideshare.com/ -
Embedded content from slideshare
-
+https://slideshare.com/ +
Embedded content from slideshare
diff --git a/core-blocks/test/fixtures/core-embed__smugmug.serialized.html b/core-blocks/test/fixtures/core-embed__smugmug.serialized.html index 1c7c9ddb3c4c6d..4878650681d70b 100644 --- a/core-blocks/test/fixtures/core-embed__smugmug.serialized.html +++ b/core-blocks/test/fixtures/core-embed__smugmug.serialized.html @@ -1,6 +1,5 @@
- https://smugmug.com/ -
Embedded content from smugmug
-
+https://smugmug.com/ +
Embedded content from smugmug
diff --git a/core-blocks/test/fixtures/core-embed__soundcloud.serialized.html b/core-blocks/test/fixtures/core-embed__soundcloud.serialized.html index 0b6353a6cc79c4..25a40a0fc9b899 100644 --- a/core-blocks/test/fixtures/core-embed__soundcloud.serialized.html +++ b/core-blocks/test/fixtures/core-embed__soundcloud.serialized.html @@ -1,6 +1,5 @@
- https://soundcloud.com/ -
Embedded content from soundcloud
-
+https://soundcloud.com/ +
Embedded content from soundcloud
diff --git a/core-blocks/test/fixtures/core-embed__speaker.serialized.html b/core-blocks/test/fixtures/core-embed__speaker.serialized.html index 0a303e131389ff..85801d3e8de2a4 100644 --- a/core-blocks/test/fixtures/core-embed__speaker.serialized.html +++ b/core-blocks/test/fixtures/core-embed__speaker.serialized.html @@ -1,6 +1,5 @@
- https://speaker.com/ -
Embedded content from speaker
-
+https://speaker.com/ +
Embedded content from speaker
diff --git a/core-blocks/test/fixtures/core-embed__spotify.serialized.html b/core-blocks/test/fixtures/core-embed__spotify.serialized.html index 0f76e2d5e2be28..5a5fa58ec9542b 100644 --- a/core-blocks/test/fixtures/core-embed__spotify.serialized.html +++ b/core-blocks/test/fixtures/core-embed__spotify.serialized.html @@ -1,6 +1,5 @@
- https://spotify.com/ -
Embedded content from spotify
-
+https://spotify.com/ +
Embedded content from spotify
diff --git a/core-blocks/test/fixtures/core-embed__ted.serialized.html b/core-blocks/test/fixtures/core-embed__ted.serialized.html index 49aae48441e774..dd3f12e10a4920 100644 --- a/core-blocks/test/fixtures/core-embed__ted.serialized.html +++ b/core-blocks/test/fixtures/core-embed__ted.serialized.html @@ -1,6 +1,5 @@
- https://ted.com/ -
Embedded content from ted
-
+https://ted.com/ +
Embedded content from ted
diff --git a/core-blocks/test/fixtures/core-embed__tumblr.serialized.html b/core-blocks/test/fixtures/core-embed__tumblr.serialized.html index 19c03bca593870..ced583d2f0574d 100644 --- a/core-blocks/test/fixtures/core-embed__tumblr.serialized.html +++ b/core-blocks/test/fixtures/core-embed__tumblr.serialized.html @@ -1,6 +1,5 @@
- https://tumblr.com/ -
Embedded content from tumblr
-
+https://tumblr.com/ +
Embedded content from tumblr
diff --git a/core-blocks/test/fixtures/core-embed__twitter.serialized.html b/core-blocks/test/fixtures/core-embed__twitter.serialized.html index d16cd2d5e62eab..71e86f0d7d2623 100644 --- a/core-blocks/test/fixtures/core-embed__twitter.serialized.html +++ b/core-blocks/test/fixtures/core-embed__twitter.serialized.html @@ -1,6 +1,5 @@
- https://twitter.com/automattic -
We are Automattic
-
+https://twitter.com/automattic +
We are Automattic
diff --git a/core-blocks/test/fixtures/core-embed__videopress.serialized.html b/core-blocks/test/fixtures/core-embed__videopress.serialized.html index 239230f7a422d0..d595d4b1c96109 100644 --- a/core-blocks/test/fixtures/core-embed__videopress.serialized.html +++ b/core-blocks/test/fixtures/core-embed__videopress.serialized.html @@ -1,6 +1,5 @@
- https://videopress.com/ -
Embedded content from videopress
-
+https://videopress.com/ +
Embedded content from videopress
diff --git a/core-blocks/test/fixtures/core-embed__vimeo.serialized.html b/core-blocks/test/fixtures/core-embed__vimeo.serialized.html index 92194178a32543..90e4626dceafb3 100644 --- a/core-blocks/test/fixtures/core-embed__vimeo.serialized.html +++ b/core-blocks/test/fixtures/core-embed__vimeo.serialized.html @@ -1,6 +1,5 @@
- https://vimeo.com/ -
Embedded content from vimeo
-
+https://vimeo.com/ +
Embedded content from vimeo
diff --git a/core-blocks/test/fixtures/core-embed__wordpress-tv.serialized.html b/core-blocks/test/fixtures/core-embed__wordpress-tv.serialized.html index fa4902494f0e76..504a9e62d698d2 100644 --- a/core-blocks/test/fixtures/core-embed__wordpress-tv.serialized.html +++ b/core-blocks/test/fixtures/core-embed__wordpress-tv.serialized.html @@ -1,6 +1,5 @@
- https://wordpress.tv/ -
Embedded content from wordpress-tv
-
+https://wordpress.tv/ +
Embedded content from wordpress-tv
diff --git a/core-blocks/test/fixtures/core-embed__wordpress.serialized.html b/core-blocks/test/fixtures/core-embed__wordpress.serialized.html index cc4f2e76ebf947..cc39b3d049d345 100644 --- a/core-blocks/test/fixtures/core-embed__wordpress.serialized.html +++ b/core-blocks/test/fixtures/core-embed__wordpress.serialized.html @@ -1,6 +1,5 @@
- https://wordpress.com/ -
Embedded content from WordPress
-
+https://wordpress.com/ +
Embedded content from WordPress
diff --git a/core-blocks/test/fixtures/core-embed__youtube.serialized.html b/core-blocks/test/fixtures/core-embed__youtube.serialized.html index fe3c90ef47ee55..f46b31ae22c8f1 100644 --- a/core-blocks/test/fixtures/core-embed__youtube.serialized.html +++ b/core-blocks/test/fixtures/core-embed__youtube.serialized.html @@ -1,6 +1,5 @@
- https://youtube.com/ -
Embedded content from youtube
-
+https://youtube.com/ +
Embedded content from youtube
diff --git a/core-blocks/test/fixtures/core__column.serialized.html b/core-blocks/test/fixtures/core__column.serialized.html index 3a9801cc3a6564..5d7839c4709185 100644 --- a/core-blocks/test/fixtures/core__column.serialized.html +++ b/core-blocks/test/fixtures/core__column.serialized.html @@ -1,11 +1,9 @@ -
- -

Column One, Paragraph One

- +
+

Column One, Paragraph One

+ - -

Column One, Paragraph Two

- -
+ +

Column One, Paragraph Two

+
diff --git a/core-blocks/test/fixtures/core__columns.serialized.html b/core-blocks/test/fixtures/core__columns.serialized.html index 55bfcfcff78e03..b7472ac094fbbb 100644 --- a/core-blocks/test/fixtures/core__columns.serialized.html +++ b/core-blocks/test/fixtures/core__columns.serialized.html @@ -1,27 +1,21 @@ -
- -
- -

Column One, Paragraph One

- +
+
+

Column One, Paragraph One

+ - -

Column One, Paragraph Two

- -
- + +

Column One, Paragraph Two

+
+ - -
- -

Column Two, Paragraph One

- + +
+

Column Two, Paragraph One

+ - -

Column Three, Paragraph One

- -
- -
+ +

Column Three, Paragraph One

+
+
diff --git a/core-blocks/test/fixtures/core__cover-image.serialized.html b/core-blocks/test/fixtures/core__cover-image.serialized.html index 87e8dc9795084f..d64692d60c8fe6 100644 --- a/core-blocks/test/fixtures/core__cover-image.serialized.html +++ b/core-blocks/test/fixtures/core__cover-image.serialized.html @@ -1,5 +1,3 @@ -
-

Guten Berg!

-
+

Guten Berg!

diff --git a/core-blocks/test/fixtures/core__embed.serialized.html b/core-blocks/test/fixtures/core__embed.serialized.html index 1b6b7b46f06ba6..b84300ecadc7b9 100644 --- a/core-blocks/test/fixtures/core__embed.serialized.html +++ b/core-blocks/test/fixtures/core__embed.serialized.html @@ -1,6 +1,5 @@
- https://example.com/ -
Embedded content from an example URL
-
+https://example.com/ +
Embedded content from an example URL
diff --git a/core-blocks/test/fixtures/core__gallery.serialized.html b/core-blocks/test/fixtures/core__gallery.serialized.html index e6aaeed3a77ecd..370c3f5571d48e 100644 --- a/core-blocks/test/fixtures/core__gallery.serialized.html +++ b/core-blocks/test/fixtures/core__gallery.serialized.html @@ -1,10 +1,3 @@ - + diff --git a/core-blocks/test/fixtures/core__gallery__columns.serialized.html b/core-blocks/test/fixtures/core__gallery__columns.serialized.html index 78d0d0f8e7f47e..1d5d8ca7da72e9 100644 --- a/core-blocks/test/fixtures/core__gallery__columns.serialized.html +++ b/core-blocks/test/fixtures/core__gallery__columns.serialized.html @@ -1,10 +1,3 @@ - + diff --git a/core-blocks/test/fixtures/core__image.serialized.html b/core-blocks/test/fixtures/core__image.serialized.html index bbe320d2bc1404..5dfb0bac3e5b72 100644 --- a/core-blocks/test/fixtures/core__image.serialized.html +++ b/core-blocks/test/fixtures/core__image.serialized.html @@ -1,3 +1,3 @@ -
+
diff --git a/core-blocks/test/fixtures/core__image__center-caption.serialized.html b/core-blocks/test/fixtures/core__image__center-caption.serialized.html index 6292e2293f1e22..f9441dab3d9971 100644 --- a/core-blocks/test/fixtures/core__image__center-caption.serialized.html +++ b/core-blocks/test/fixtures/core__image__center-caption.serialized.html @@ -1,5 +1,3 @@ -
-
Give it a try. Press the "really wide" button on the image toolbar.
-
+
Give it a try. Press the "really wide" button on the image toolbar.
diff --git a/core-blocks/test/fixtures/core__list__ul.serialized.html b/core-blocks/test/fixtures/core__list__ul.serialized.html index 70eb6a4e76ff3d..6b83b73a47ea1d 100644 --- a/core-blocks/test/fixtures/core__list__ul.serialized.html +++ b/core-blocks/test/fixtures/core__list__ul.serialized.html @@ -1,10 +1,3 @@ - + diff --git a/core-blocks/test/fixtures/core__pullquote.serialized.html b/core-blocks/test/fixtures/core__pullquote.serialized.html index 02aa277f756539..ae5fb6ac94f3a1 100644 --- a/core-blocks/test/fixtures/core__pullquote.serialized.html +++ b/core-blocks/test/fixtures/core__pullquote.serialized.html @@ -1,4 +1,3 @@ -
-

Testing pullquote block...

...with a caption
+

Testing pullquote block...

...with a caption
diff --git a/core-blocks/test/fixtures/core__pullquote__multi-paragraph.serialized.html b/core-blocks/test/fixtures/core__pullquote__multi-paragraph.serialized.html index 58d40223987735..8445a7c9b1bf2e 100644 --- a/core-blocks/test/fixtures/core__pullquote__multi-paragraph.serialized.html +++ b/core-blocks/test/fixtures/core__pullquote__multi-paragraph.serialized.html @@ -1,5 +1,3 @@ -
-

Paragraph one

-

Paragraph two

by whomever
+

Paragraph one

Paragraph two

by whomever
diff --git a/core-blocks/test/fixtures/core__quote__style-1.serialized.html b/core-blocks/test/fixtures/core__quote__style-1.serialized.html index a56c5859bd335d..4268c4139854e7 100644 --- a/core-blocks/test/fixtures/core__quote__style-1.serialized.html +++ b/core-blocks/test/fixtures/core__quote__style-1.serialized.html @@ -1,4 +1,3 @@ -
-

The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017
+

The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017
diff --git a/core-blocks/test/fixtures/core__quote__style-2.serialized.html b/core-blocks/test/fixtures/core__quote__style-2.serialized.html index c10e778ee98d44..b257de24088e9a 100644 --- a/core-blocks/test/fixtures/core__quote__style-2.serialized.html +++ b/core-blocks/test/fixtures/core__quote__style-2.serialized.html @@ -1,4 +1,3 @@ -
-

There is no greater agony than bearing an untold story inside you.

Maya Angelou
+

There is no greater agony than bearing an untold story inside you.

Maya Angelou
diff --git a/core-blocks/test/fixtures/core__separator.serialized.html b/core-blocks/test/fixtures/core__separator.serialized.html index 102fede296a018..cb5aeea74070c0 100644 --- a/core-blocks/test/fixtures/core__separator.serialized.html +++ b/core-blocks/test/fixtures/core__separator.serialized.html @@ -1,3 +1,3 @@ -
+
diff --git a/core-blocks/test/fixtures/core__table.serialized.html b/core-blocks/test/fixtures/core__table.serialized.html index 28fbbea7833c5f..a791eb149f6273 100644 --- a/core-blocks/test/fixtures/core__table.serialized.html +++ b/core-blocks/test/fixtures/core__table.serialized.html @@ -1,48 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VersionMusicianDate
.70No musician chosen.May 27, 2003
1.0Miles DavisJanuary 3, 2004
Lots of versions skipped, see the full list
4.4Clifford BrownDecember 8, 2015
4.5Coleman HawkinsApril 12, 2016
4.6Pepper AdamsAugust 16, 2016
4.7Sarah VaughanDecember 6, 2016
+
VersionMusicianDate
.70No musician chosen.May 27, 2003
1.0Miles DavisJanuary 3, 2004
Lots of versions skipped, see the full list
4.4Clifford BrownDecember 8, 2015
4.5Coleman HawkinsApril 12, 2016
4.6Pepper AdamsAugust 16, 2016
4.7Sarah VaughanDecember 6, 2016
diff --git a/core-blocks/test/fixtures/core__text-columns.serialized.html b/core-blocks/test/fixtures/core__text-columns.serialized.html index c730faf2b4b2c9..8ae01efcb9c9be 100644 --- a/core-blocks/test/fixtures/core__text-columns.serialized.html +++ b/core-blocks/test/fixtures/core__text-columns.serialized.html @@ -1,10 +1,3 @@ -
-
-

One

-
-
-

Two

-
-
+

One

Two

diff --git a/core-blocks/test/fixtures/core__text__converts-to-paragraph.serialized.html b/core-blocks/test/fixtures/core__text__converts-to-paragraph.serialized.html index 7a11c004984d1f..61fd699dace637 100644 --- a/core-blocks/test/fixtures/core__text__converts-to-paragraph.serialized.html +++ b/core-blocks/test/fixtures/core__text__converts-to-paragraph.serialized.html @@ -1,3 +1,3 @@ -

This is an old-style text block. Changed to paragraph in #2135.

+

This is an old-style text block. Changed to paragraph in #2135.

diff --git a/editor/components/inner-blocks/test/__snapshots__/index.js.snap b/editor/components/inner-blocks/test/__snapshots__/index.js.snap index abbf1a84bfdcee..5766351dc3c236 100644 --- a/editor/components/inner-blocks/test/__snapshots__/index.js.snap +++ b/editor/components/inner-blocks/test/__snapshots__/index.js.snap @@ -2,11 +2,9 @@ exports[`InnerBlocks should force serialize for invalid block with inner blocks 1`] = ` " -

Invalid - -

- -

+

Invalid +

+

" `; diff --git a/package-lock.json b/package-lock.json index c5771e30e66276..3e03a08e4e2b30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3632,7 +3632,8 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true }, "acorn": { "version": "5.7.1", @@ -5275,7 +5276,8 @@ "bluebird": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true }, "bn.js": { "version": "4.11.8", @@ -6258,7 +6260,8 @@ "commander": { "version": "2.16.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.16.0.tgz", - "integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==" + "integrity": "sha512-sVXqklSaotK9at437sFlFpyOcJonxe0yST/AG9DkQKUdIE6IqGIMv4SfAQSKaJbSdVEJYItASCrBiVQHq1HQew==", + "dev": true }, "comment-parser": { "version": "0.4.2", @@ -6423,6 +6426,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz", "integrity": "sha1-q6CXR9++TD5w52am5BWG4YWfxvI=", + "dev": true, "requires": { "ini": "^1.3.4", "proto-list": "~1.2.1" @@ -7639,18 +7643,6 @@ "integrity": "sha512-gzao+mxnYDzIysXKMQi/+M1mjy/rjestjg6OPoYTtI+3Izp23oiGZitsl9lPDPiTGXbcSIk1iJWhliSaglxnUg==", "dev": true }, - "editorconfig": { - "version": "0.13.3", - "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.13.3.tgz", - "integrity": "sha512-WkjsUNVCu+ITKDj73QDvi0trvpdDWdkDyHybDGSXPfekLCqwmpD7CP7iPbvBgosNuLcI96XTDwNa75JyFl7tEQ==", - "requires": { - "bluebird": "^3.0.5", - "commander": "^2.9.0", - "lru-cache": "^3.2.0", - "semver": "^5.1.0", - "sigmund": "^1.0.1" - } - }, "ejs": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.6.1.tgz", @@ -10499,7 +10491,8 @@ "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true }, "init-package-json": { "version": "1.10.3", @@ -12741,17 +12734,6 @@ "integrity": "sha512-O9SR2NVICx6rCqh1qsU91QZ5IoNa+2T1ROJ0OQlfvATKGmnjsAvg3r0E5ufPZ4a95jdKTPXhFWiE/sOZ7a5Rtg==", "dev": true }, - "js-beautify": { - "version": "1.6.14", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.6.14.tgz", - "integrity": "sha1-07j3Mi0CuSd9WL0jgmTDJ+WARM0=", - "requires": { - "config-chain": "~1.1.5", - "editorconfig": "^0.13.2", - "mkdirp": "~0.5.0", - "nopt": "~3.0.1" - } - }, "js-levenshtein": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.3.tgz", @@ -13727,14 +13709,6 @@ "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", "dev": true }, - "lru-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", - "integrity": "sha1-cXibO39Tmb7IVl3aOKow0qCX7+4=", - "requires": { - "pseudomap": "^1.0.1" - } - }, "make-dir": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", @@ -14111,7 +14085,8 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true }, "minimist-options": { "version": "3.0.2", @@ -14184,6 +14159,7 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { "minimist": "0.0.8" } @@ -14705,6 +14681,7 @@ "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, "requires": { "abbrev": "1" } @@ -17901,7 +17878,8 @@ "proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=" + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=", + "dev": true }, "proxy-from-env": { "version": "1.0.0", @@ -19435,11 +19413,6 @@ "yargs": "^10.0.3" } }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" - }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", diff --git a/package.json b/package.json index 198f64f2729531..07fa9c52fa721d 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "eslint-plugin-wordpress": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#1774343f6226052a46b081e01db3fca8793cc9f1", "hpq": "1.2.0", "jquery": "3.3.1", - "js-beautify": "1.6.14", "lodash": "4.17.10", "memize": "1.0.5", "moment": "2.22.1", diff --git a/test/e2e/specs/__snapshots__/adding-blocks.test.js.snap b/test/e2e/specs/__snapshots__/adding-blocks.test.js.snap index edc0b163cff072..e86a7aaa2fb661 100644 --- a/test/e2e/specs/__snapshots__/adding-blocks.test.js.snap +++ b/test/e2e/specs/__snapshots__/adding-blocks.test.js.snap @@ -6,13 +6,11 @@ exports[`adding blocks Should insert content using the placeholder and the regul -
-

Quote block

-
+

Quote block

-
\\"\\"
+
\\"\\"/
@@ -26,9 +24,7 @@ exports[`adding blocks Should insert content using the placeholder and the regul -
-

Quote block

-
+

Quote block

" `; @@ -42,9 +38,7 @@ exports[`adding blocks Should insert content using the placeholder and the regul -
-

Quote block

-
+

Quote block

diff --git a/test/e2e/specs/__snapshots__/style-variation.test.js.snap b/test/e2e/specs/__snapshots__/style-variation.test.js.snap index 4808dc75208fe9..abbafd01334b4a 100644 --- a/test/e2e/specs/__snapshots__/style-variation.test.js.snap +++ b/test/e2e/specs/__snapshots__/style-variation.test.js.snap @@ -2,8 +2,6 @@ exports[`adding blocks Should switch the style of the quote block 1`] = ` " -
-

Quote content

-
+

Quote content

" `; diff --git a/test/e2e/specs/__snapshots__/templates.test.js.snap b/test/e2e/specs/__snapshots__/templates.test.js.snap index 91729413e1f27e..b4058d88c930bb 100644 --- a/test/e2e/specs/__snapshots__/templates.test.js.snap +++ b/test/e2e/specs/__snapshots__/templates.test.js.snap @@ -2,7 +2,7 @@ exports[`Using a CPT with a predefined template Should add a custom post types with a predefined template 1`] = ` " -
\\"\\"
+
\\"\\"/
@@ -14,22 +14,16 @@ exports[`Using a CPT with a predefined template Should add a custom post types w -
- -
- -
\\"\\"
- -
- +
+
+
\\"\\"/
+
+ - -
- -

- -
- -
+ +
+

+
+
" `; diff --git a/test/e2e/specs/__snapshots__/writing-flow.test.js.snap b/test/e2e/specs/__snapshots__/writing-flow.test.js.snap index 07b9570077de24..578cc425e4874b 100644 --- a/test/e2e/specs/__snapshots__/writing-flow.test.js.snap +++ b/test/e2e/specs/__snapshots__/writing-flow.test.js.snap @@ -6,23 +6,17 @@ exports[`adding blocks Should navigate inner blocks with arrow keys 1`] = ` -
- -
- -

First column paragraph

- -
- +
+
+

First column paragraph

+
+ - -
- -

Second column paragraph

- -
- -
+ +
+

Second column paragraph

+
+
diff --git a/test/e2e/specs/adding-inline-tokens.test.js b/test/e2e/specs/adding-inline-tokens.test.js index 52c5efec172ccd..8e611b300f71e9 100644 --- a/test/e2e/specs/adding-inline-tokens.test.js +++ b/test/e2e/specs/adding-inline-tokens.test.js @@ -41,7 +41,7 @@ describe( 'adding inline tokens', () => { await page.click( '.media-modal button.media-button-select' ); // Check the content. - const regex = new RegExp( '\\s*

a\\u00A0<\\/p>\\s*' ); + const regex = new RegExp( '\\s*

a\\u00A0<\\/p>\\s*' ); expect( await getEditedPostContent() ).toMatch( regex ); } ); } ); diff --git a/test/integration/blocks-raw-handling.spec.js b/test/integration/blocks-raw-handling.spec.js index 0b86ec1835c3c3..c2a9bc2a3cc39e 100644 --- a/test/integration/blocks-raw-handling.spec.js +++ b/test/integration/blocks-raw-handling.spec.js @@ -38,7 +38,7 @@ describe( 'Blocks raw handling', () => { mode: 'AUTO', } ).map( getBlockContent ).join( '' ); - expect( filtered ).toBe( '

' ); + expect( filtered ).toBe( '' ); expect( console ).toHaveLogged(); } ); diff --git a/test/integration/fixtures/apple-out.html b/test/integration/fixtures/apple-out.html index b2f2435d8188ee..530bf8d34140c2 100644 --- a/test/integration/fixtures/apple-out.html +++ b/test/integration/fixtures/apple-out.html @@ -11,63 +11,33 @@ - + -
    -
  1. One
  2. -
  3. Two
  4. -
  5. Three
  6. -
+
  1. One
  2. Two
  3. Three
- - - - - - - - - - - - - - - - - - -
- One - - Two - - Three -
- 1 - - 2 - - 3 -
- I - - II - - III -
+
+One + +Two + +Three +
+1 + +2 + +3 +
+I + +II + +III +
diff --git a/test/integration/fixtures/classic-out.html b/test/integration/fixtures/classic-out.html index 1298053376dfa0..dbc94528db7b22 100644 --- a/test/integration/fixtures/classic-out.html +++ b/test/integration/fixtures/classic-out.html @@ -15,7 +15,7 @@ -

Fourth paragraph

+

Fourth paragraph

diff --git a/test/integration/fixtures/evernote-out.html b/test/integration/fixtures/evernote-out.html index 2add7ec7a2f8fb..f9dee59c5259d3 100644 --- a/test/integration/fixtures/evernote-out.html +++ b/test/integration/fixtures/evernote-out.html @@ -1,60 +1,31 @@

This is a paragraph. -
This is a link. -

+
This is a link. +

- + -
    -
  1. One
  2. -
  3. Two -
      -
    1. Indented
    2. -
    -
  4. -
  5. Three
  6. -
+
  1. One
  2. Two
    1. Indented
  3. Three
-
+
- - - - - - - - - - - - - -
One - Two - Three -
Four - Five - Six -
+
One +Two +Three +
Four +Five +Six +
-
+
diff --git a/test/integration/fixtures/google-docs-out.html b/test/integration/fixtures/google-docs-out.html index b0e18c5d654216..d76b19eee24887 100644 --- a/test/integration/fixtures/google-docs-out.html +++ b/test/integration/fixtures/google-docs-out.html @@ -11,49 +11,19 @@

This is a heading

- + -
    -
  1. One
  2. -
  3. Two
  4. -
  5. Three
  6. -
+
  1. One
  2. Two
  3. Three
- - - - - - - - - - - - - - - - - - -
OneTwoThree
123
IIIIII
+
OneTwoThree
123
IIIIII
-
+
@@ -61,6 +31,6 @@

This is a heading

-
+
diff --git a/test/integration/fixtures/markdown-out.html b/test/integration/fixtures/markdown-out.html index b665ba06b63f79..46b1f91d82abe4 100644 --- a/test/integration/fixtures/markdown-out.html +++ b/test/integration/fixtures/markdown-out.html @@ -7,7 +7,8 @@

This is a heading with italic

-

Preserve
line breaks please.

+

Preserve
+line breaks please.

@@ -15,23 +16,11 @@

Lists

- + -
    -
  1. One
  2. -
  3. Two
  4. -
  5. Three
  6. -
+
  1. One
  2. Two
  3. Three
@@ -39,24 +28,7 @@

Table

- - - - - - - - - - - - - - - - - -
First HeaderSecond Header
Content from cell 1Content from cell 2
Content in the first columnContent in the second column
+
First HeaderSecond Header
Content from cell 1Content from cell 2
Content in the first columnContent in the second column
@@ -64,10 +36,7 @@

Quote

-
-

First

-

Second

-
+

First

Second

diff --git a/test/integration/fixtures/ms-word-online-out.html b/test/integration/fixtures/ms-word-online-out.html index 2208ea83d16a02..3508d818deeb5f 100644 --- a/test/integration/fixtures/ms-word-online-out.html +++ b/test/integration/fixtures/ms-word-online-out.html @@ -7,42 +7,15 @@ - + -
    -
  1. One 
  2. -
  3. Two 
  4. -
  5. Three 
  6. -
+
  1. One 
  2. Two 
  3. Three 
- - - - - - - - - - - - - - - - - - -
One Two Three 
II III 
+
One Two Three 
II III 
@@ -50,5 +23,5 @@ -
+
diff --git a/test/integration/fixtures/ms-word-out.html b/test/integration/fixtures/ms-word-out.html index 54bc1e810e936a..c53c5aaeba2e97 100644 --- a/test/integration/fixtures/ms-word-out.html +++ b/test/integration/fixtures/ms-word-out.html @@ -1,11 +1,11 @@ -

This is a title -

+

This is a +title

-

This is a subtitle -

+

This is a +subtitle

@@ -21,63 +21,33 @@

This is a heading level 2

- + -
    -
  1. One
  2. -
  3. Two
  4. -
  5. Three
  6. -
+
  1. One
  2. Two
  3. Three
- - - - - - - - - - - - - - - - - - -
- One - - Two - - Three -
- 1 - - 2 - - 3 -
- I - - II - - III -
+
+ One + + Two + + Three +
+ 1 + + 2 + + 3 +
+ I + + II + + III +
@@ -85,5 +55,5 @@

This is a heading level 2

-
+
diff --git a/test/integration/fixtures/one-image-out.html b/test/integration/fixtures/one-image-out.html index c0ba9c111dd938..defa0138370faf 100644 --- a/test/integration/fixtures/one-image-out.html +++ b/test/integration/fixtures/one-image-out.html @@ -1,3 +1,3 @@ -
+
diff --git a/test/integration/fixtures/two-images-out.html b/test/integration/fixtures/two-images-out.html index f0bc8d22576717..4b96a052a52b7b 100644 --- a/test/integration/fixtures/two-images-out.html +++ b/test/integration/fixtures/two-images-out.html @@ -1,7 +1,7 @@ -
+
-
+
diff --git a/test/integration/fixtures/wordpress-out.html b/test/integration/fixtures/wordpress-out.html index 68cee54e709b5c..a0767e31a1c8dc 100644 --- a/test/integration/fixtures/wordpress-out.html +++ b/test/integration/fixtures/wordpress-out.html @@ -19,9 +19,5 @@

Shortcode

- + From 9457f0197df6c7160b114f22efa6c22b4a521ed2 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 11 Jul 2018 10:48:08 -0400 Subject: [PATCH 2/2] Testing: Verify shortcode block newlines preserved --- test/e2e/specs/__snapshots__/adding-blocks.test.js.snap | 7 ++++++- test/e2e/specs/adding-blocks.test.js | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/test/e2e/specs/__snapshots__/adding-blocks.test.js.snap b/test/e2e/specs/__snapshots__/adding-blocks.test.js.snap index e86a7aaa2fb661..eaf8254a78cc85 100644 --- a/test/e2e/specs/__snapshots__/adding-blocks.test.js.snap +++ b/test/e2e/specs/__snapshots__/adding-blocks.test.js.snap @@ -43,5 +43,10 @@ exports[`adding blocks Should insert content using the placeholder and the regul
Pre text

Foo
-" + + + +[myshortcode]With multiple +lines preserved[/myshortcode] +" `; diff --git a/test/e2e/specs/adding-blocks.test.js b/test/e2e/specs/adding-blocks.test.js index 329fcccff3be5a..e6b74f4fd58c67 100644 --- a/test/e2e/specs/adding-blocks.test.js +++ b/test/e2e/specs/adding-blocks.test.js @@ -71,6 +71,13 @@ describe( 'adding blocks', () => { await pressTimes( 'Delete', 6 ); await page.keyboard.type( ' text' ); + // Ensure newline preservation in shortcode block. + // See: https://github.com/WordPress/gutenberg/issues/4456 + await insertBlock( 'Shortcode' ); + await page.keyboard.type( '[myshortcode]With multiple' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( 'lines preserved[/myshortcode]' ); + // Unselect blocks to avoid conflicts with the inbetween inserter await page.click( '.editor-post-title__input' );