<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[44118] trunk: Blocks: Parse blocks when displaying posts.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/44118">44118</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/44118","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>desrosj</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2018-12-13 18:11:10 +0000 (Thu, 13 Dec 2018)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Blocks: Parse blocks when displaying posts.
Posts containing blocks are now correctly handled when displaying on the front end, including dynamic blocks and nested blocks.
Props pento.
Merges <a href="https://core.trac.wordpress.org/changeset/43752">[43752]</a> to trunk.
See <a href="https://core.trac.wordpress.org/ticket/45109">#45109</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesblocksphp">trunk/src/wp-includes/blocks.php</a></li>
<li><a href="#trunksrcwpincludesclasswpblockparserphp">trunk/src/wp-includes/class-wp-block-parser.php</a></li>
<li><a href="#trunksrcwpincludesdefaultfiltersphp">trunk/src/wp-includes/default-filters.php</a></li>
<li><a href="#trunksrcwpincludesformattingphp">trunk/src/wp-includes/formatting.php</a></li>
<li><a href="#trunksrcwpsettingsphp">trunk/src/wp-settings.php</a></li>
<li><a href="#trunktestsphpunitdatablocksdoblocksexpectedhtml">trunk/tests/phpunit/data/blocks/do-blocks-expected.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__columnparsedjson">trunk/tests/phpunit/data/blocks/fixtures/core__column.parsed.json</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__columnsparsedjson">trunk/tests/phpunit/data/blocks/fixtures/core__columns.parsed.json</a></li>
<li><a href="#trunktestsphpunitincludesfunctionsphp">trunk/tests/phpunit/includes/functions.php</a></li>
<li><a href="#trunktestsphpunittestsblocksblockparserphp">trunk/tests/phpunit/tests/blocks/block-parser.php</a></li>
<li><a href="#trunktoolswebpackpackagesjs">trunk/tools/webpack/packages.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/src/wp-includes/blocks/</li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__4invalidstartingletterserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__archivesserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__archives.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__archives__showPostCountsserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__audioserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__audio.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__blockserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__block.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__button__centerserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__button__center.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__categoriesserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__categories.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__codeserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__code.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__columnserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__column.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__columnsserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__columns.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__coverimageserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__cover-image.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__embedserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__embed.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__file__newwindowserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__file__new-window.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__file__nodownloadbuttonserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__file__no-download-button.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__file__notextlinkserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__freeformserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__freeform.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__freeform__undelimitedserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__galleryserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__gallery.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__gallery__columnsserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__gallery__columns.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__heading__h2emserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__heading__h2-em.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__heading__h2serverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__heading__h2.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__htmlserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__html.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__imageserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__image.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__image__attachmentlinkserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__image__attachment-link.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__image__centercaptionserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__image__center-caption.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__image__customlinkserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__image__custom-link.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__image__medialinkserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__image__media-link.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__invalidCapitalsserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__invalidspecialserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__invalid-special.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__latestcommentsserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__latest-comments.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__latestpostsserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__latest-posts.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__latestposts__displayPostDateserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__list__ulserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__list__ul.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__missingserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__missing.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__moreserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__more.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__more__customtextteaserserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__nextpageserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__nextpage.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__paragraph__alignrightserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__paragraph__deprecatedserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__preformattedserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__preformatted.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__pullquoteserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__pullquote.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__pullquote__multiparagraphserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__quote__style1serverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__quote__style-1.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__quote__style2serverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__quote__style-2.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__separatorserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__separator.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__shortcodeserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__shortcode.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__spacerserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__spacer.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__subheadserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__subhead.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__tableserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__table.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__textcolumnsserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__text-columns.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__text__convertstoparagraphserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__verseserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__verse.server.html</a></li>
<li><a href="#trunktestsphpunitdatablocksfixturescore__videoserverhtml">trunk/tests/phpunit/data/blocks/fixtures/core__video.server.html</a></li>
<li><a href="#trunktestsphpunittestsblocksrenderphp">trunk/tests/phpunit/tests/blocks/render.php</a></li>
</ul>
<h3>Property Changed</h3>
<ul>
<li><a href="#trunk">trunk/</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<span class="cx" style="display: block; padding: 0 10px">Index: trunk
</span><span class="cx" style="display: block; padding: 0 10px">===================================================================
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">--- trunk 2018-12-13 17:51:31 UTC (rev 44117)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+++ trunk 2018-12-13 18:11:10 UTC (rev 44118)
</ins><a id="trunk"></a>
<div class="propset"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Property changes: trunk</h4>
<pre class="diff"><span>
</span></pre></div>
<a id="svnmergeinfo"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: svn:mergeinfo</h4></div>
<span class="cx" style="display: block; padding: 0 10px"> /branches/3.3:20543
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/3.4:21757
</span><span class="cx" style="display: block; padding: 0 10px"> /branches/4.9:43557
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-/branches/5.0:43681-43682,43684-43688,43719-43720,43723,43726-43727,43729-43731,43734-43744,43751
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/branches/5.0:43681-43682,43684-43688,43719-43720,43723,43726-43727,43729-43731,43734-43744,43751-43752
</ins><span class="cx" style="display: block; padding: 0 10px"> /trunk:18512
</span><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="trunksrcwpincludesblocksphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/blocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/blocks.php 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/src/wp-includes/blocks.php 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -114,6 +114,44 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Remove all dynamic blocks from the given content.
+ *
+ * @since 5.0.0
+ *
+ * @param string $content Content of the current post.
+ * @return string
+ */
+function strip_dynamic_blocks( $content ) {
+ return _recurse_strip_dynamic_blocks( parse_blocks( $content ) );
+}
+
+/**
+ * Helper function for strip_dynamic_blocks(), to recurse through the block tree.
+ *
+ * @since 5.0.0
+ * @access private
+ *
+ * @param array $blocks Array of blocks from parse_blocks().
+ * @return string HTML from the non-dynamic blocks.
+ */
+function _recurse_strip_dynamic_blocks( $blocks ) {
+ $clean_content = '';
+ $dynamic_blocks = get_dynamic_block_names();
+
+ foreach ( $blocks as $block ) {
+ if ( ! in_array( $block['blockName'], $dynamic_blocks ) ) {
+ if ( $block['innerBlocks'] ) {
+ $clean_content .= _recurse_strip_dynamic_blocks( $block['innerBlocks'] );
+ } else {
+ $clean_content .= $block['innerHTML'];
+ }
+ }
+ }
+
+ return $clean_content;
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Parses blocks out of a content string.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.0.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +180,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $parser_class Name of block parser class
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $parser_class Name of block parser class.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $parser_class = apply_filters( 'block_parser_class', 'WP_Block_Parser' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,3 +187,78 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $parser = new $parser_class();
</span><span class="cx" style="display: block; padding: 0 10px"> return $parser->parse( $content );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/**
+ * Parses dynamic blocks out of `post_content` and re-renders them.
+ *
+ * @since 5.0.0
+ * @global WP_Post $post The post to edit.
+ *
+ * @param string $content Post content.
+ * @return string Updated post content.
+ */
+function do_blocks( $content ) {
+ $blocks = parse_blocks( $content );
+ return _recurse_do_blocks( $blocks, $blocks );
+}
+
+/**
+ * Helper function for do_blocks(), to recurse through the block tree.
+ *
+ * @since 5.0.0
+ * @access private
+ *
+ * @param array $blocks Array of blocks from parse_blocks().
+ * @param array $all_blocks The top level array of blocks.
+ * @return string The block HTML.
+ */
+function _recurse_do_blocks( $blocks, $all_blocks ) {
+ global $post;
+
+ /*
+ * Back up global post, to restore after render callback.
+ * Allows callbacks to run new WP_Query instances without breaking the global post.
+ */
+ $global_post = $post;
+
+ $rendered_content = '';
+ $dynamic_blocks = get_dynamic_block_names();
+
+ foreach ( $blocks as $block ) {
+ $block = (array) $block;
+ if ( in_array( $block['blockName'], $dynamic_blocks ) ) {
+ // Find registered block type. We can assume it exists since we use the
+ // `get_dynamic_block_names` function as a source for pattern matching.
+ $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
+
+ // Replace dynamic block with server-rendered output.
+ $block_content = $block_type->render( (array) $block['attrs'], $block['innerHTML'] );
+ } elseif ( $block['innerBlocks'] ) {
+ $block_content = _recurse_do_blocks( $block['innerBlocks'], $blocks );
+ } else {
+ $block_content = $block['innerHTML'];
+ }
+
+ /**
+ * Filters the content of a single block.
+ *
+ * During the_content, each block is parsed and added to the output individually. This filter allows
+ * that content to be altered immediately before it's appended.
+ *
+ * @since 5.0.0
+ *
+ * @param string $block_content The block content about to be appended.
+ * @param array $block The full block, including name and attributes.
+ * @param array $all_blocks The array of all blocks being processed.
+ */
+ $rendered_content .= apply_filters( 'do_block', $block_content, $block, $all_blocks );
+
+ // Restore global $post.
+ $post = $global_post;
+ }
+
+ // Strip remaining block comment demarcations.
+ $rendered_content = preg_replace( '/<!--\s+\/?wp:.*?-->/m', '', $rendered_content );
+
+ return $rendered_content;
+}
</ins></span></pre></div>
<a id="trunksrcwpincludesclasswpblockparserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-block-parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-block-parser.php 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/src/wp-includes/class-wp-block-parser.php 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,10 +310,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * otherwise we're nested and we have to close out the current
</span><span class="cx" style="display: block; padding: 0 10px"> * block and add it as a new innerBlock to the parent
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $stack_top = array_pop( $this->stack );
- $stack_top->block->innerHTML .= substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset );
- $stack_top->prev_offset = $start_offset + $token_length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $stack_top = array_pop( $this->stack );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset );
+ if ( $stack_top->block->innerBlocks ) {
+ $stack_top->block->innerBlocks[] = (array) $this->freeform( $html );
+ } else {
+ $stack_top->block->innerHTML = $html;
+ }
+
+ $stack_top->prev_offset = $start_offset + $token_length;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->add_inner_block(
</span><span class="cx" style="display: block; padding: 0 10px"> $stack_top->block,
</span><span class="cx" style="display: block; padding: 0 10px"> $stack_top->token_start,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -445,8 +452,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $parent = $this->stack[ count( $this->stack ) - 1 ];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $parent->block->innerBlocks[] = $block;
- $parent->block->innerHTML .= substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parent->block->innerBlocks[] = (array) $this->freeform( substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ) );
+ $parent->block->innerBlocks[] = (array) $block;
</ins><span class="cx" style="display: block; padding: 0 10px"> $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -461,10 +468,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $stack_top = array_pop( $this->stack );
</span><span class="cx" style="display: block; padding: 0 10px"> $prev_offset = $stack_top->prev_offset;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $stack_top->block->innerHTML .= isset( $end_offset )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $html = isset( $end_offset )
</ins><span class="cx" style="display: block; padding: 0 10px"> ? substr( $this->document, $prev_offset, $end_offset - $prev_offset )
</span><span class="cx" style="display: block; padding: 0 10px"> : substr( $this->document, $prev_offset );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $stack_top->block->innerBlocks ) {
+ $stack_top->block->innerBlocks[] = (array) $this->freeform( $html );
+ } else {
+ $stack_top->block->innerHTML = $html;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $stack_top->leading_html_start ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->output[] = (array) self::freeform(
</span><span class="cx" style="display: block; padding: 0 10px"> substr(
</span></span></pre></div>
<a id="trunksrcwpincludesdefaultfiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/default-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/default-filters.php 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/src/wp-includes/default-filters.php 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,6 +181,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'the_title', 'convert_chars' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'the_title', 'trim' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_filter( 'the_content', 'do_blocks', 9 );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'the_content', 'wptexturize' );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'the_content', 'convert_smilies', 20 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'the_content', 'wpautop' );
</span></span></pre></div>
<a id="trunksrcwpincludesformattingphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/formatting.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/formatting.php 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/src/wp-includes/formatting.php 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -458,6 +458,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // We don't need to autop posts with blocks in them.
+ if ( has_blocks( $pee ) ) {
+ return $pee;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Just to make things a little easier, pad the end.
</span><span class="cx" style="display: block; padding: 0 10px"> $pee = $pee . "\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3635,6 +3640,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $text = get_the_content( '' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $text = strip_shortcodes( $text );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $text = strip_dynamic_blocks( $text );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/post-template.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $text = apply_filters( 'the_content', $text );
</span></span></pre></div>
<a id="trunksrcwpsettingsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-settings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-settings.php 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/src/wp-settings.php 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -248,6 +248,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require( ABSPATH . WPINC . '/class-wp-block-parser.php' );
</span><span class="cx" style="display: block; padding: 0 10px"> require( ABSPATH . WPINC . '/blocks.php' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+require( ABSPATH . WPINC . '/blocks/archives.php' );
+require( ABSPATH . WPINC . '/blocks/block.php' );
+require( ABSPATH . WPINC . '/blocks/categories.php' );
+require( ABSPATH . WPINC . '/blocks/latest-comments.php' );
+require( ABSPATH . WPINC . '/blocks/latest-posts.php' );
+require( ABSPATH . WPINC . '/blocks/shortcode.php' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $GLOBALS['wp_embed'] = new WP_Embed();
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunktestsphpunitdatablocksdoblocksexpectedhtml"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/blocks/do-blocks-expected.html</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/do-blocks-expected.html 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/tests/phpunit/data/blocks/do-blocks-expected.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2,13 +2,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <!--more-->
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> <p>First Gutenberg Paragraph</p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> <p>Second Auto Paragraph</p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <p>Third Gutenberg Paragraph</p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> <p>Third Auto Paragraph</p>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <p>[someshortcode]</p>
</span></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__4invalidstartingletterserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__4invalidstartingletterserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__archivesserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__archivesserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__archives.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__archives.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__archives.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__archives.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<div class="wp-block-archives">No archives to show.</div>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__archives__showPostCountsserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__archives__showPostCountsserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<div class="wp-block-archives">No archives to show.</div>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__audioserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__audioserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__audio.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__audio.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__audio.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__audio.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,5 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<figure class="wp-block-audio alignright">
+ <audio controls="" src="https://media.simplecast.com/episodes/audio/80564/draft-podcast-51-livePublish2.mp3"></audio>
+</figure>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__blockserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__blockserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__block.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__block.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__block.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__block.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__button__centerserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__button__centerserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__button__center.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__button__center.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__button__center.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__button__center.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="wp-block-button aligncenter"><a class="wp-block-button__link" href="https://github.com/WordPress/gutenberg">Help build Gutenberg</a></div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__categoriesserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__categoriesserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__categories.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__categories.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__categories.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__categories.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<ul class="wp-block-categories wp-block-categories-list aligncenter"><li class="cat-item-none">No categories</li></ul>
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__codeserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__codeserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__code.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__code.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__code.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__code.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,5 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<pre class="wp-block-code"><code>export default function MyButton() {
+ return <Button>Click Me!</Button>;
+}</code></pre>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__columnparsedjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/blocks/fixtures/core__column.parsed.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__column.parsed.json 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__column.parsed.json 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3,6 +3,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "blockName": "core/column",
</span><span class="cx" style="display: block; padding: 0 10px"> "attrs": {},
</span><span class="cx" style="display: block; padding: 0 10px"> "innerBlocks": [
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n<div class=\"wp-block-column\">\n\t"
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "blockName": "core/paragraph",
</span><span class="cx" style="display: block; padding: 0 10px"> "attrs": {},
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,14 +15,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "innerBlocks": [],
</span><span class="cx" style="display: block; padding: 0 10px"> "innerHTML": "\n\t<p>Column One, Paragraph One</p>\n\t"
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\t"
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "blockName": "core/paragraph",
</span><span class="cx" style="display: block; padding: 0 10px"> "attrs": {},
</span><span class="cx" style="display: block; padding: 0 10px"> "innerBlocks": [],
</span><span class="cx" style="display: block; padding: 0 10px"> "innerHTML": "\n\t<p>Column One, Paragraph Two</p>\n\t"
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- ],
- "innerHTML": "\n<div class=\"wp-block-column\">\n\t\n\t\n</div>\n"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n</div>\n"
+ }
+ ],
+ "innerHTML": ""
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "blockName": null,
</span></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__columnserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__columnserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__column.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__column.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__column.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__column.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,10 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="wp-block-column">
+
+ <p>Column One, Paragraph One</p>
+
+
+ <p>Column One, Paragraph Two</p>
+
+</div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__columnsparsedjson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/data/blocks/fixtures/core__columns.parsed.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__columns.parsed.json 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__columns.parsed.json 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,46 +5,100 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "columns": 3
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> "innerBlocks": [
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n<div class=\"wp-block-columns has-3-columns\">\n\t"
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "blockName": "core/column",
</span><span class="cx" style="display: block; padding: 0 10px"> "attrs": {},
</span><span class="cx" style="display: block; padding: 0 10px"> "innerBlocks": [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\t<div class=\"wp-block-column\">\n\t\t"
+ },
+ {
</ins><span class="cx" style="display: block; padding: 0 10px"> "blockName": "core/paragraph",
</span><span class="cx" style="display: block; padding: 0 10px"> "attrs": {},
</span><span class="cx" style="display: block; padding: 0 10px"> "innerBlocks": [],
</span><span class="cx" style="display: block; padding: 0 10px"> "innerHTML": "\n\t\t<p>Column One, Paragraph One</p>\n\t\t"
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\t\t"
+ },
+ {
</ins><span class="cx" style="display: block; padding: 0 10px"> "blockName": "core/paragraph",
</span><span class="cx" style="display: block; padding: 0 10px"> "attrs": {},
</span><span class="cx" style="display: block; padding: 0 10px"> "innerBlocks": [],
</span><span class="cx" style="display: block; padding: 0 10px"> "innerHTML": "\n\t\t<p>Column One, Paragraph Two</p>\n\t\t"
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\t</div>\n\t"
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "innerHTML": "\n\t<div class=\"wp-block-column\">\n\t\t\n\t\t\n\t</div>\n\t"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "innerHTML": ""
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\t"
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "blockName": "core/column",
</span><span class="cx" style="display: block; padding: 0 10px"> "attrs": {},
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "innerBlocks": [
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "innerBlocks": [
+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\t<div class=\"wp-block-column\">\n\t\t"
+ },
+ {
</ins><span class="cx" style="display: block; padding: 0 10px"> "blockName": "core/paragraph",
</span><span class="cx" style="display: block; padding: 0 10px"> "attrs": {},
</span><span class="cx" style="display: block; padding: 0 10px"> "innerBlocks": [],
</span><span class="cx" style="display: block; padding: 0 10px"> "innerHTML": "\n\t\t<p>Column Two, Paragraph One</p>\n\t\t"
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\t\t"
+ },
+ {
</ins><span class="cx" style="display: block; padding: 0 10px"> "blockName": "core/paragraph",
</span><span class="cx" style="display: block; padding: 0 10px"> "attrs": {},
</span><span class="cx" style="display: block; padding: 0 10px"> "innerBlocks": [],
</span><span class="cx" style="display: block; padding: 0 10px"> "innerHTML": "\n\t\t<p>Column Three, Paragraph One</p>\n\t\t"
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n\t</div>\n\t"
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "innerHTML": "\n\t<div class=\"wp-block-column\">\n\t\t\n\t\t\n\t</div>\n\t"
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "innerHTML": ""
+ },
+ {
+ "blockName": null,
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\n</div>\n"
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- "innerHTML": "\n<div class=\"wp-block-columns has-3-columns\">\n\t\n\t\n</div>\n"
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "innerHTML": ""
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> "blockName": null,
</span></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__columnsserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__columnsserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__columns.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__columns.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__columns.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__columns.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,24 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="wp-block-columns has-3-columns">
+
+ <div class="wp-block-column">
+
+ <p>Column One, Paragraph One</p>
+
+
+ <p>Column One, Paragraph Two</p>
+
+ </div>
+
+
+ <div class="wp-block-column">
+
+ <p>Column Two, Paragraph One</p>
+
+
+ <p>Column Three, Paragraph One</p>
+
+ </div>
+
+</div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__coverimageserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__coverimageserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__cover-image.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__cover-image.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__cover-image.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__cover-image.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,5 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="wp-block-cover-image has-background-dim-40 has-background-dim" style="background-image:url(https://cldup.com/uuUqE_dXzy.jpg)">
+ <p class="wp-block-cover-image-text">Guten Berg!</p>
+</div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__embedserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__embedserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__embed.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__embed.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__embed.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__embed.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,8 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<figure class="wp-block-embed">
+ <div class="wp-block-embed__wrapper">
+ https://example.com/
+ </div>
+ <figcaption>Embedded content from an example URL</figcaption>
+</figure>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__file__newwindowserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__file__newwindowserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__file__new-window.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__file__new-window.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__file__new-window.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__file__new-window.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="wp-block-file"><a href="http://localhost:8888/wp-content/uploads/2018/05/keycodes.js" target="_blank" rel="noreferrer noopener">6546</a><a href="http://localhost:8888/wp-content/uploads/2018/05/keycodes.js" class="wp-block-file__button" download="6546">Download</a></div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__file__nodownloadbuttonserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__file__nodownloadbuttonserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__file__no-download-button.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__file__no-download-button.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__file__no-download-button.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__file__no-download-button.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="wp-block-file"><a href="http://localhost:8888/?attachment_id=176">lkjfijwef</a></div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__file__notextlinkserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__file__notextlinkserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__file__no-text-link.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="wp-block-file"><a href="http://localhost:8888/wp-content/uploads/2018/05/keycodes.js" class="wp-block-file__button" download="">Download</a></div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__freeformserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__freeformserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__freeform.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__freeform.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__freeform.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__freeform.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,6 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+Testing freeform block with some
+<div class="wp-some-class">
+ HTML <span style="color: red;">content</span>
+</div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__freeform__undelimitedserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__freeform__undelimitedserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,4 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+Testing freeform block with some
+<div class="wp-some-class">
+ HTML <span style="color: red;">content</span>
+</div>
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__galleryserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__galleryserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__gallery.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__gallery.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__gallery.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__gallery.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,14 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<ul class="wp-block-gallery columns-2 is-cropped">
+ <li class="blocks-gallery-item">
+ <figure>
+ <img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title" />
+ </figure>
+ </li>
+ <li class="blocks-gallery-item">
+ <figure>
+ <img src="http://google.com/hi.png" alt="title" />
+ </figure>
+ </li>
+</ul>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__gallery__columnsserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__gallery__columnsserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__gallery__columns.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__gallery__columns.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__gallery__columns.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__gallery__columns.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,14 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<ul class="wp-block-gallery columns-1 is-cropped">
+ <li class="blocks-gallery-item">
+ <figure>
+ <img src="https://cldup.com/uuUqE_dXzy.jpg" alt="title" />
+ </figure>
+ </li>
+ <li class="blocks-gallery-item">
+ <figure>
+ <img src="http://google.com/hi.png" alt="title" />
+ </figure>
+ </li>
+</ul>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__heading__h2emserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__heading__h2emserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__heading__h2-em.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__heading__h2-em.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__heading__h2-em.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__heading__h2-em.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<h2>The <em>Inserter</em> Tool</h2>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__heading__h2serverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__heading__h2serverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__heading__h2.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__heading__h2.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__heading__h2.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__heading__h2.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<h2>A picture is worth a thousand words, or so the saying goes</h2>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__htmlserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__htmlserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__html.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__html.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__html.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__html.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,4 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<h1>Some HTML code</h1>
+<marquee>This text will scroll from right to left</marquee>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__imageserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__imageserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__image.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__image.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__image.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__image.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<figure class="wp-block-image"><img src="https://cldup.com/uuUqE_dXzy.jpg" alt="" /></figure>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__image__attachmentlinkserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__image__attachmentlinkserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__image__attachment-link.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__image__attachment-link.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__image__attachment-link.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__image__attachment-link.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<figure class="wp-block-image"><a href="http://localhost:8888/?attachment_id=7"><img src="https://cldup.com/uuUqE_dXzy.jpg" alt="" /></a></figure>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__image__centercaptionserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__image__centercaptionserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__image__center-caption.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__image__center-caption.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__image__center-caption.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__image__center-caption.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="wp-block-image"><figure class="aligncenter"><img src="https://cldup.com/YLYhpou2oq.jpg" alt="" /><figcaption>Give it a try. Press the "really wide" button on the image toolbar.</figcaption></figure></div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__image__customlinkserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__image__customlinkserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__image__custom-link.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__image__custom-link.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__image__custom-link.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__image__custom-link.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<figure class="wp-block-image"><a href="https://wordpress.org/"><img src="https://cldup.com/uuUqE_dXzy.jpg" alt="" /></a></figure>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__image__medialinkserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__image__medialinkserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__image__media-link.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__image__media-link.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__image__media-link.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__image__media-link.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<figure class="wp-block-image"><a href="https://cldup.com/uuUqE_dXzy.jpg"><img src="https://cldup.com/uuUqE_dXzy.jpg" alt="" /></a></figure>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__invalidCapitalsserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__invalidCapitalsserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__invalidspecialserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__invalidspecialserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__invalid-special.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__invalid-special.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__invalid-special.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__invalid-special.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__latestcommentsserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__latestcommentsserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__latest-comments.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__latest-comments.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__latest-comments.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__latest-comments.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<div class="wp-block-latest-comments has-avatars has-dates has-excerpts no-comments">No comments to show.</div>
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__latestpostsserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__latestpostsserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__latest-posts.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__latest-posts.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__latest-posts.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__latest-posts.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<ul class="wp-block-latest-posts"></ul>
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__latestposts__displayPostDateserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__latestposts__displayPostDateserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<ul class="wp-block-latest-posts"></ul>
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__list__ulserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__list__ulserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__list__ul.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__list__ul.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__list__ul.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__list__ul.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<ul><li>Text & Headings</li><li>Images & Videos</li><li>Galleries</li><li>Embeds, like YouTube, Tweets, or other WordPress posts.</li><li>Layout blocks, like Buttons, Hero Images, Separators, etc.</li><li>And <em>Lists</em> like this one of course :)</li></ul>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__missingserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__missingserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__missing.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__missing.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__missing.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__missing.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,6 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<p>Testing missing block with some</p>
+<div class="wp-some-class">
+ HTML <span style="color: red;">content</span>
+</div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__moreserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__moreserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__more.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__more.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__more.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__more.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<!--more-->
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__more__customtextteaserserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__more__customtextteaserserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,4 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<!--more Continue Reading-->
+<!--noteaser-->
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__nextpageserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__nextpageserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__nextpage.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__nextpage.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__nextpage.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__nextpage.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<!--nextpage-->
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__paragraph__alignrightserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__paragraph__alignrightserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<p style="text-align:right;">... like this one, which is separate from the above and right aligned.</p>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__paragraph__deprecatedserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__paragraph__deprecatedserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+Unwrapped is <em>still</em> valid.
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__preformattedserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__preformattedserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__preformatted.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__preformatted.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__preformatted.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__preformatted.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<pre class="wp-block-preformatted">Some <em>preformatted</em> text...<br>And more!</pre>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__pullquoteserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__pullquoteserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__pullquote.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__pullquote.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__pullquote.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__pullquote.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,7 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<figure class="wp-block-pullquote">
+ <blockquote>
+ <p>Testing pullquote block...</p><cite>...with a caption</cite>
+ </blockquote>
+</figure>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__pullquote__multiparagraphserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__pullquote__multiparagraphserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,9 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<figure class="wp-block-pullquote">
+ <blockquote>
+ <p>Paragraph <strong>one</strong></p>
+ <p>Paragraph two</p>
+ <cite>by whomever</cite>
+ </blockquote>
+</figure>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__quote__style1serverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__quote__style1serverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__quote__style-1.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__quote__style-1.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__quote__style-1.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__quote__style-1.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<blockquote class="wp-block-quote"><p>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.</p><cite>Matt Mullenweg, 2017</cite></blockquote>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__quote__style2serverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__quote__style2serverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__quote__style-2.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__quote__style-2.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__quote__style-2.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__quote__style-2.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<blockquote class="wp-block-quote is-style-large"><p>There is no greater agony than bearing an untold story inside you.</p><cite>Maya Angelou</cite></blockquote>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__separatorserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__separatorserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__separator.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__separator.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__separator.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__separator.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<hr class="wp-block-separator" />
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__shortcodeserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__shortcodeserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__shortcode.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__shortcode.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__shortcode.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__shortcode.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,2 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<p>[gallery ids="238,338"]</p>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__spacerserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__spacerserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__spacer.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__spacer.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__spacer.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__spacer.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__subheadserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__subheadserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__subhead.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__subhead.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__subhead.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__subhead.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<p class="wp-block-subhead">This is a <em>subhead</em>.</p>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__tableserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__tableserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__table.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__table.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__table.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__table.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<table class="wp-block-table"><thead><tr><th>Version</th><th>Musician</th><th>Date</th></tr></thead><tbody><tr><td><a href="https://wordpress.org/news/2003/05/wordpress-now-available/">.70</a></td><td>No musician chosen.</td><td>May 27, 2003</td></tr><tr><td><a href="https://wordpress.org/news/2004/01/wordpress-10/">1.0</a></td><td>Miles Davis</td><td>January 3, 2004</td></tr><tr><td>Lots of versions skipped, see <a href="https://codex.wordpress.org/WordPress_Versions">the full list</a></td><td>…</td><td>…</td></tr><tr><td><a href="https://wordpress.org/news/2015/12/clifford/">4.4</a></td><td>Clifford Brown</td><td>De
cember 8, 2015</td></tr><tr><td><a href="https://wordpress.org/news/2016/04/coleman/">4.5</a></td><td>Coleman Hawkins</td><td>April 12, 2016</td></tr><tr><td><a href="https://wordpress.org/news/2016/08/pepper/">4.6</a></td><td>Pepper Adams</td><td>August 16, 2016</td></tr><tr><td><a href="https://wordpress.org/news/2016/12/vaughan/">4.7</a></td><td>Sarah Vaughan</td><td>December 6, 2016</td></tr></tbody></table>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__textcolumnsserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__textcolumnsserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__text-columns.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__text-columns.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__text-columns.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__text-columns.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,10 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="wp-block-text-columns aligncenter columns-2">
+ <div class="wp-block-column">
+ <p>One</p>
+ </div>
+ <div class="wp-block-column">
+ <p>Two</p>
+ </div>
+</div>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__text__convertstoparagraphserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__text__convertstoparagraphserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<p>This is an old-style text block. Changed to <code>paragraph</code> in #2135.</p>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__verseserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__verseserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__verse.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__verse.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__verse.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__verse.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<pre class="wp-block-verse">A <em>verse</em>…<br>And more!</pre>
+
</ins></span></pre></div>
<a id="trunktestsphpunitdatablocksfixturescore__videoserverhtmlfromrev43752branches50testsphpunitdatablocksfixturescore__videoserverhtml"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/data/blocks/fixtures/core__video.server.html (from rev 43752, branches/5.0/tests/phpunit/data/blocks/fixtures/core__video.server.html)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/data/blocks/fixtures/core__video.server.html (rev 0)
+++ trunk/tests/phpunit/data/blocks/fixtures/core__video.server.html 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,3 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<figure class="wp-block-video"><video controls src="https://awesome-fake.video/file.mp4"></video></figure>
+
</ins></span></pre></div>
<a id="trunktestsphpunitincludesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/includes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/includes/functions.php 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/tests/phpunit/includes/functions.php 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -212,3 +212,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Skip `setcookie` calls in auth_cookie functions due to warning:
</span><span class="cx" style="display: block; padding: 0 10px"> // Cannot modify header information - headers already sent by ...
</span><span class="cx" style="display: block; padding: 0 10px"> tests_add_filter( 'send_auth_cookies', '__return_false' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+/**
+ * After the init action has been run once, trying to re-register block types can cause
+ * _doing_it_wrong warnings. To avoid this, unhook the block registration functions.
+ *
+ * @since 5.0.0
+ */
+function _unhook_block_registration() {
+ remove_action( 'init', 'register_block_core_archives' );
+ remove_action( 'init', 'register_block_core_categories' );
+ remove_action( 'init', 'register_block_core_latest_posts' );
+ remove_action( 'init', 'register_block_core_shortcode' );
+}
+tests_add_filter( 'init', '_unhook_block_registration', 1000 );
</ins></span></pre></div>
<a id="trunktestsphpunittestsblocksblockparserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/blocks/block-parser.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/block-parser.php 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/tests/phpunit/tests/blocks/block-parser.php 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -59,7 +59,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array( $html_path, $parsed_json_path ) as $filename ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! file_exists( $filename ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- //throw new Exception( "Missing fixture file: '$filename'" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ throw new Exception( "Missing fixture file: '$filename'" );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,5 +116,4 @@
</span><span class="cx" style="display: block; padding: 0 10px"> protected function strip_r( $input ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return str_replace( "\r", '', $input );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsblocksrenderphpfromrev43752branches50testsphpunittestsblocksrenderphp"></a>
<div class="copfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Copied: trunk/tests/phpunit/tests/blocks/render.php (from rev 43752, branches/5.0/tests/phpunit/tests/blocks/render.php)</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/render.php (rev 0)
+++ trunk/tests/phpunit/tests/blocks/render.php 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,310 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Block rendering tests.
+ *
+ * @package WordPress
+ * @subpackage Blocks
+ * @since 5.0.0
+ */
+
+/**
+ * Tests for block rendering functions
+ *
+ * @since 5.0.0
+ *
+ * @group blocks
+ */
+class WP_Test_Block_Render extends WP_UnitTestCase {
+ /**
+ * The location of the fixtures to test with.
+ *
+ * @since 5.0.0
+ * @var string
+ */
+ protected static $fixtures_dir;
+
+ /**
+ * Test block instance number.
+ *
+ * @since 5.0.0
+ *
+ * @var int
+ */
+ protected $test_block_instance_number = 0;
+
+ /**
+ * Tear down after each test.
+ *
+ * @since 5.0.0
+ */
+ public function tearDown() {
+ parent::tearDown();
+
+ $this->test_block_instance_number = 0;
+
+ $registry = WP_Block_Type_Registry::get_instance();
+ if ( $registry->is_registered( 'core/test' ) ) {
+ $registry->unregister( 'core/test' );
+ }
+ }
+
+ /**
+ * @ticket 45109
+ */
+ public function test_do_blocks_removes_comments() {
+ $original_html = file_get_contents( DIR_TESTDATA . '/blocks/do-blocks-original.html' );
+ $expected_html = file_get_contents( DIR_TESTDATA . '/blocks/do-blocks-expected.html' );
+
+ $actual_html = do_blocks( $original_html );
+
+ $this->assertEquals( $expected_html, $actual_html );
+ }
+
+ /**
+ * @ticket 45109
+ */
+ public function test_the_content() {
+ add_shortcode( 'someshortcode', array( $this, 'handle_shortcode' ) );
+
+ $classic_content = "Foo\n\n[someshortcode]\n\nBar\n\n[/someshortcode]\n\nBaz";
+ $block_content = "<!-- wp:core/paragraph -->\n<p>Foo</p>\n<!-- /wp:core/paragraph -->\n\n<!-- wp:core/shortcode -->[someshortcode]\n\nBar\n\n[/someshortcode]<!-- /wp:core/shortcode -->\n\n<!-- wp:core/paragraph -->\n<p>Baz</p>\n<!-- /wp:core/paragraph -->";
+
+ $classic_filtered_content = apply_filters( 'the_content', $classic_content );
+ $block_filtered_content = apply_filters( 'the_content', $block_content );
+
+ // Block rendering add some extra blank lines, but we're not worried about them.
+ $block_filtered_content = preg_replace( "/\n{2,}/", "\n", $block_filtered_content );
+
+ $this->assertEquals( $classic_filtered_content, $block_filtered_content );
+ }
+
+ function handle_shortcode( $atts, $content ) {
+ return $content;
+ }
+
+ /**
+ * @ticket 45109
+ */
+ public function data_do_block_test_filenames() {
+ self::$fixtures_dir = DIR_TESTDATA . '/blocks/fixtures';
+
+ $fixture_filenames = array_merge(
+ glob( self::$fixtures_dir . '/*.json' ),
+ glob( self::$fixtures_dir . '/*.html' )
+ );
+
+ $fixture_filenames = array_values(
+ array_unique(
+ array_map(
+ array( $this, 'clean_fixture_filename' ),
+ $fixture_filenames
+ )
+ )
+ );
+
+ return array_map(
+ array( $this, 'pass_parser_fixture_filenames' ),
+ $fixture_filenames
+ ); }
+
+ /**
+ * @dataProvider data_do_block_test_filenames
+ * @ticket 45109
+ */
+ public function test_do_block_output( $html_filename, $server_html_filename ) {
+ $html_path = self::$fixtures_dir . '/' . $html_filename;
+ $server_html_path = self::$fixtures_dir . '/' . $server_html_filename;
+
+ foreach ( array( $html_path, $server_html_path ) as $filename ) {
+ if ( ! file_exists( $filename ) ) {
+ throw new Exception( "Missing fixture file: '$filename'" );
+ }
+ }
+
+ $html = do_blocks( self::strip_r( file_get_contents( $html_path ) ) );
+ $expected_html = self::strip_r( file_get_contents( $server_html_path ) );
+
+ $this->assertEquals(
+ $expected_html,
+ $html,
+ "File '$html_path' does not match expected value"
+ );
+ }
+
+ /**
+ * @ticket 45109
+ */
+ public function test_dynamic_block_rendering() {
+ $settings = array(
+ 'render_callback' => array(
+ $this,
+ 'render_test_block',
+ ),
+ );
+ register_block_type( 'core/test', $settings );
+
+ // The duplicated dynamic blocks below are there to ensure that do_blocks() replaces each one-by-one.
+ $post_content =
+ 'before' .
+ '<!-- wp:core/test {"value":"b1"} --><!-- /wp:core/test -->' .
+ '<!-- wp:core/test {"value":"b1"} --><!-- /wp:core/test -->' .
+ 'between' .
+ '<!-- wp:core/test {"value":"b2"} /-->' .
+ '<!-- wp:core/test {"value":"b2"} /-->' .
+ 'after';
+
+ $updated_post_content = do_blocks( $post_content );
+ $this->assertEquals(
+ $updated_post_content,
+ 'before' .
+ '1:b1' .
+ '2:b1' .
+ 'between' .
+ '3:b2' .
+ '4:b2' .
+ 'after'
+ );
+ }
+
+ /**
+ * @ticket 45109
+ */
+ public function test_global_post_persistence() {
+ global $post;
+
+ register_block_type(
+ 'core/test',
+ array(
+ 'render_callback' => array(
+ $this,
+ 'render_test_block_wp_query',
+ ),
+ )
+ );
+
+ $posts = self::factory()->post->create_many( 5 );
+ $post = get_post( end( $posts ) );
+
+ $global_post = $post;
+ do_blocks( '<!-- wp:core/test /-->' );
+
+ $this->assertEquals( $global_post, $post );
+ }
+
+ /**
+ * @ticket 45109
+ */
+ public function test_dynamic_block_renders_string() {
+ $settings = array(
+ 'render_callback' => array(
+ $this,
+ 'render_test_block_numeric',
+ ),
+ );
+
+ register_block_type( 'core/test', $settings );
+ $block_type = new WP_Block_Type( 'core/test', $settings );
+
+ $rendered = $block_type->render();
+
+ $this->assertSame( '10', $rendered );
+ $this->assertInternalType( 'string', $rendered );
+ }
+
+ /**
+ * Helper function to remove relative paths and extension from a filename, leaving just the fixture name.
+ *
+ * @since 5.0.0
+ *
+ * @param string $filename The filename to clean.
+ * @return string The cleaned fixture name.
+ */
+ protected function clean_fixture_filename( $filename ) {
+ $filename = basename( $filename );
+ $filename = preg_replace( '/\..+$/', '', $filename );
+ return $filename;
+ }
+
+ /**
+ * Helper function to return the filenames needed to test the parser output.
+ *
+ * @since 5.0.0
+ *
+ * @param string $filename The cleaned fixture name.
+ * @return array The input and expected output filenames for that fixture.
+ */
+ protected function pass_parser_fixture_filenames( $filename ) {
+ return array(
+ "$filename.html",
+ "$filename.server.html",
+ );
+ }
+
+ /**
+ * Helper function to remove '\r' characters from a string.
+ *
+ * @since 5.0.0
+ *
+ * @param string $input The string to remove '\r' from.
+ * @return string The input string, with '\r' characters removed.
+ */
+ protected function strip_r( $input ) {
+ return str_replace( "\r", '', $input );
+ }
+
+ /**
+ * Test block rendering function.
+ *
+ * @since 5.0.0
+ *
+ * @param array $attributes Block attributes.
+ * @return string Block output.
+ */
+ public function render_test_block( $attributes ) {
+ $this->test_block_instance_number += 1;
+ return $this->test_block_instance_number . ':' . $attributes['value'];
+ }
+
+ /**
+ * Test block rendering function, returning numeric value.
+ *
+ * @since 5.0.0
+ *
+ * @return int Block output.
+ */
+ public function render_test_block_numeric() {
+ return 10;
+ }
+
+ /**
+ * Test block rendering function, creating a new WP_Query instance.
+ *
+ * @since 5.0.0
+ *
+ * @return string Block output.
+ */
+ public function render_test_block_wp_query() {
+ $content = '';
+ $recent = new WP_Query(
+ array(
+ 'numberposts' => 10,
+ 'orderby' => 'ID',
+ 'order' => 'DESC',
+ 'post_type' => 'post',
+ 'post_status' => 'draft, publish, future, pending, private',
+ 'suppress_filters' => true,
+ )
+ );
+
+ while ( $recent->have_posts() ) {
+ $recent->the_post();
+
+ $content .= get_the_title();
+ }
+
+ wp_reset_postdata();
+
+ return $content;
+ }
+
+}
</ins></span></pre></div>
<a id="trunktoolswebpackpackagesjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tools/webpack/packages.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tools/webpack/packages.js 2018-12-13 17:51:31 UTC (rev 44117)
+++ trunk/tools/webpack/packages.js 2018-12-13 18:11:10 UTC (rev 44118)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +117,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const phpFiles = {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'block-serialization-default-parser/parser.php': 'wp-includes/class-wp-block-parser.php',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Parser shouldn't be copied until nested block issues are resolved.
+ // 'block-serialization-default-parser/parser.php': 'wp-includes/class-wp-block-parser.php',
+ 'block-library/src/archives/index.php': 'wp-includes/blocks/archives.php',
+ 'block-library/src/block/index.php': 'wp-includes/blocks/block.php',
+ 'block-library/src/categories/index.php': 'wp-includes/blocks/categories.php',
+ 'block-library/src/latest-comments/index.php': 'wp-includes/blocks/latest-comments.php',
+ 'block-library/src/latest-posts/index.php': 'wp-includes/blocks/latest-posts.php',
+ 'block-library/src/shortcode/index.php': 'wp-includes/blocks/shortcode.php',
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const externals = {
</span></span></pre>
</div>
</div>
</body>
</html>