Changeset 43751
- Timestamp:
- 10/18/2018 04:39:40 AM (7 years ago)
- Location:
- branches/5.0
- Files:
-
- 215 added
- 3 edited
-
src/wp-includes/blocks.php (modified) (1 diff)
-
src/wp-includes/class-wp-block-parser.php (added)
-
src/wp-settings.php (modified) (1 diff)
-
tests/phpunit/data/blocks/fixtures (added)
-
tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.html (added)
-
tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.json (added)
-
tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__4-invalid-starting-letter.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__archives.html (added)
-
tests/phpunit/data/blocks/fixtures/core__archives.json (added)
-
tests/phpunit/data/blocks/fixtures/core__archives.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__archives.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.html (added)
-
tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.json (added)
-
tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__archives__showPostCounts.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__audio.html (added)
-
tests/phpunit/data/blocks/fixtures/core__audio.json (added)
-
tests/phpunit/data/blocks/fixtures/core__audio.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__audio.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__block.html (added)
-
tests/phpunit/data/blocks/fixtures/core__block.json (added)
-
tests/phpunit/data/blocks/fixtures/core__block.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__block.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__button__center.html (added)
-
tests/phpunit/data/blocks/fixtures/core__button__center.json (added)
-
tests/phpunit/data/blocks/fixtures/core__button__center.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__button__center.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__categories.html (added)
-
tests/phpunit/data/blocks/fixtures/core__categories.json (added)
-
tests/phpunit/data/blocks/fixtures/core__categories.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__categories.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__code.html (added)
-
tests/phpunit/data/blocks/fixtures/core__code.json (added)
-
tests/phpunit/data/blocks/fixtures/core__code.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__code.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__column.html (added)
-
tests/phpunit/data/blocks/fixtures/core__column.json (added)
-
tests/phpunit/data/blocks/fixtures/core__column.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__column.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__columns.html (added)
-
tests/phpunit/data/blocks/fixtures/core__columns.json (added)
-
tests/phpunit/data/blocks/fixtures/core__columns.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__columns.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__cover-image.html (added)
-
tests/phpunit/data/blocks/fixtures/core__cover-image.json (added)
-
tests/phpunit/data/blocks/fixtures/core__cover-image.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__cover-image.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__embed.html (added)
-
tests/phpunit/data/blocks/fixtures/core__embed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__embed.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__embed.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__file__new-window.html (added)
-
tests/phpunit/data/blocks/fixtures/core__file__new-window.json (added)
-
tests/phpunit/data/blocks/fixtures/core__file__new-window.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__file__new-window.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__file__no-download-button.html (added)
-
tests/phpunit/data/blocks/fixtures/core__file__no-download-button.json (added)
-
tests/phpunit/data/blocks/fixtures/core__file__no-download-button.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__file__no-download-button.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__file__no-text-link.html (added)
-
tests/phpunit/data/blocks/fixtures/core__file__no-text-link.json (added)
-
tests/phpunit/data/blocks/fixtures/core__file__no-text-link.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__file__no-text-link.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__freeform.html (added)
-
tests/phpunit/data/blocks/fixtures/core__freeform.json (added)
-
tests/phpunit/data/blocks/fixtures/core__freeform.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__freeform.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.html (added)
-
tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.json (added)
-
tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__freeform__undelimited.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__gallery.html (added)
-
tests/phpunit/data/blocks/fixtures/core__gallery.json (added)
-
tests/phpunit/data/blocks/fixtures/core__gallery.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__gallery.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__gallery__columns.html (added)
-
tests/phpunit/data/blocks/fixtures/core__gallery__columns.json (added)
-
tests/phpunit/data/blocks/fixtures/core__gallery__columns.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__gallery__columns.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__heading__h2-em.html (added)
-
tests/phpunit/data/blocks/fixtures/core__heading__h2-em.json (added)
-
tests/phpunit/data/blocks/fixtures/core__heading__h2-em.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__heading__h2-em.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__heading__h2.html (added)
-
tests/phpunit/data/blocks/fixtures/core__heading__h2.json (added)
-
tests/phpunit/data/blocks/fixtures/core__heading__h2.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__heading__h2.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__html.html (added)
-
tests/phpunit/data/blocks/fixtures/core__html.json (added)
-
tests/phpunit/data/blocks/fixtures/core__html.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__html.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image__attachment-link.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image__attachment-link.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image__attachment-link.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image__attachment-link.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image__center-caption.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image__center-caption.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image__center-caption.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image__center-caption.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image__custom-link.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image__custom-link.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image__custom-link.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image__custom-link.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image__media-link.html (added)
-
tests/phpunit/data/blocks/fixtures/core__image__media-link.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image__media-link.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__image__media-link.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.html (added)
-
tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.json (added)
-
tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__invalid-Capitals.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__invalid-special.html (added)
-
tests/phpunit/data/blocks/fixtures/core__invalid-special.json (added)
-
tests/phpunit/data/blocks/fixtures/core__invalid-special.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__invalid-special.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-comments.html (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-comments.json (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-comments.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-comments.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-posts.html (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-posts.json (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-posts.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-posts.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.html (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.json (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__latest-posts__displayPostDate.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__list__ul.html (added)
-
tests/phpunit/data/blocks/fixtures/core__list__ul.json (added)
-
tests/phpunit/data/blocks/fixtures/core__list__ul.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__list__ul.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__missing.html (added)
-
tests/phpunit/data/blocks/fixtures/core__missing.json (added)
-
tests/phpunit/data/blocks/fixtures/core__missing.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__missing.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__more.html (added)
-
tests/phpunit/data/blocks/fixtures/core__more.json (added)
-
tests/phpunit/data/blocks/fixtures/core__more.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__more.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.html (added)
-
tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.json (added)
-
tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__more__custom-text-teaser.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__nextpage.html (added)
-
tests/phpunit/data/blocks/fixtures/core__nextpage.json (added)
-
tests/phpunit/data/blocks/fixtures/core__nextpage.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__nextpage.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.html (added)
-
tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.json (added)
-
tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__paragraph__align-right.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.html (added)
-
tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.json (added)
-
tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__paragraph__deprecated.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__preformatted.html (added)
-
tests/phpunit/data/blocks/fixtures/core__preformatted.json (added)
-
tests/phpunit/data/blocks/fixtures/core__preformatted.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__preformatted.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__pullquote.html (added)
-
tests/phpunit/data/blocks/fixtures/core__pullquote.json (added)
-
tests/phpunit/data/blocks/fixtures/core__pullquote.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__pullquote.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.html (added)
-
tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.json (added)
-
tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__pullquote__multi-paragraph.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__quote__style-1.html (added)
-
tests/phpunit/data/blocks/fixtures/core__quote__style-1.json (added)
-
tests/phpunit/data/blocks/fixtures/core__quote__style-1.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__quote__style-1.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__quote__style-2.html (added)
-
tests/phpunit/data/blocks/fixtures/core__quote__style-2.json (added)
-
tests/phpunit/data/blocks/fixtures/core__quote__style-2.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__quote__style-2.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__separator.html (added)
-
tests/phpunit/data/blocks/fixtures/core__separator.json (added)
-
tests/phpunit/data/blocks/fixtures/core__separator.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__separator.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__shortcode.html (added)
-
tests/phpunit/data/blocks/fixtures/core__shortcode.json (added)
-
tests/phpunit/data/blocks/fixtures/core__shortcode.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__shortcode.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__spacer.html (added)
-
tests/phpunit/data/blocks/fixtures/core__spacer.json (added)
-
tests/phpunit/data/blocks/fixtures/core__spacer.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__spacer.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__subhead.html (added)
-
tests/phpunit/data/blocks/fixtures/core__subhead.json (added)
-
tests/phpunit/data/blocks/fixtures/core__subhead.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__subhead.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__table.html (added)
-
tests/phpunit/data/blocks/fixtures/core__table.json (added)
-
tests/phpunit/data/blocks/fixtures/core__table.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__table.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__text-columns.html (added)
-
tests/phpunit/data/blocks/fixtures/core__text-columns.json (added)
-
tests/phpunit/data/blocks/fixtures/core__text-columns.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__text-columns.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.html (added)
-
tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.json (added)
-
tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__text__converts-to-paragraph.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__verse.html (added)
-
tests/phpunit/data/blocks/fixtures/core__verse.json (added)
-
tests/phpunit/data/blocks/fixtures/core__verse.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__verse.serialized.html (added)
-
tests/phpunit/data/blocks/fixtures/core__video.html (added)
-
tests/phpunit/data/blocks/fixtures/core__video.json (added)
-
tests/phpunit/data/blocks/fixtures/core__video.parsed.json (added)
-
tests/phpunit/data/blocks/fixtures/core__video.serialized.html (added)
-
tests/phpunit/tests/blocks/block-parser.php (added)
-
tools/webpack/packages.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/blocks.php
r43743 r43751 113 113 return $dynamic_block_names; 114 114 } 115 116 /** 117 * Parses blocks out of a content string. 118 * 119 * @since 5.0.0 120 * 121 * @param string $content Post content. 122 * @return array Array of parsed block objects. 123 */ 124 function parse_blocks( $content ) { 125 /* 126 * If there are no blocks in the content, return a single block, rather 127 * than wasting time trying to parse the string. 128 */ 129 if ( ! has_blocks( $content ) ) { 130 return array( 131 array( 132 'blockName' => null, 133 'attrs' => array(), 134 'innerBlocks' => array(), 135 'innerHTML' => $content, 136 ), 137 ); 138 } 139 140 /** 141 * Filter to allow plugins to replace the server-side block parser 142 * 143 * @since 5.0.0 144 * 145 * @param string $parser_class Name of block parser class 146 */ 147 $parser_class = apply_filters( 'block_parser_class', 'WP_Block_Parser' ); 148 149 $parser = new $parser_class(); 150 return $parser->parse( $content ); 151 } -
branches/5.0/src/wp-settings.php
r43742 r43751 246 246 require( ABSPATH . WPINC . '/class-wp-block-type.php' ); 247 247 require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' ); 248 require( ABSPATH . WPINC . '/class-wp-block-parser.php' ); 248 249 require( ABSPATH . WPINC . '/blocks.php' ); 249 250 -
branches/5.0/tools/webpack/packages.js
r43723 r43751 117 117 }; 118 118 119 const phpFiles = { 120 'block-serialization-default-parser/parser.php': 'wp-includes/class-wp-block-parser.php', 121 }; 122 119 123 const externals = { 120 124 react: 'React', … … 165 169 } ) ); 166 170 171 const phpCopies = Object.keys( phpFiles ).map( ( filename ) => ( { 172 from: join( baseDir, `node_modules/@wordpress/${ filename }` ), 173 to: join( baseDir, `src/${ phpFiles[ filename ] }` ), 174 } ) ); 175 167 176 const config = { 168 177 mode, … … 233 242 ...vendorCopies, 234 243 ...cssCopies, 244 ...phpCopies, 235 245 ], 236 246 ),
Note: See TracChangeset
for help on using the changeset viewer.