From f153e171ed3550955420e06f3513200dbd66a4d6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 17 Sep 2022 17:29:21 +0000 Subject: [PATCH] Docs: Revert the `WP_Block_Parser` documentation changes now. This commit reverts [54193] and [54194]. It appears that these changes should first be made [https://github.com/WordPress/gutenberg/blob/533e0b7dad99a4b52c1d79a2e8d2bf36a2e6f819/packages/block-serialization-default-parser/parser.php upstream in the Gutenberg respository] and then backported to core, as the [https://github.com/WordPress/wordpress-develop/actions/runs/3074068296/jobs/4966609235#step:8:1 tests fail otherwise]. See #56581. git-svn-id: https://develop.svn.wordpress.org/trunk@54195 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-block-parser.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/class-wp-block-parser.php b/src/wp-includes/class-wp-block-parser.php index e627117c79..27c85cfcd2 100644 --- a/src/wp-includes/class-wp-block-parser.php +++ b/src/wp-includes/class-wp-block-parser.php @@ -62,7 +62,7 @@ class WP_Block_Parser_Block { * 'innerContent' => array( 'Before', null, 'Inner', null, 'After' ), * ) * - * @since 5.0.0 + * @since 4.2.0 * @var array */ public $innerContent; @@ -164,9 +164,10 @@ class WP_Block_Parser_Frame { /** * Class WP_Block_Parser * - * Parses a document and constructs a list of parsed blocks. + * Parses a document and constructs a list of parsed block objects * * @since 5.0.0 + * @since 4.0.0 returns arrays not objects, all attributes are arrays */ class WP_Block_Parser { /** @@ -191,7 +192,7 @@ class WP_Block_Parser { * List of parsed blocks * * @since 5.0.0 - * @var array[] + * @var WP_Block_Parser_Block[] */ public $output; @@ -206,7 +207,7 @@ class WP_Block_Parser { /** * Empty associative array, here due to PHP quirks * - * @since 5.0.0 + * @since 4.4.0 * @var array empty associative array */ public $empty_attrs; @@ -221,7 +222,7 @@ class WP_Block_Parser { * @since 5.0.0 * * @param string $document Input document being parsed. - * @return array[] + * @return WP_Block_Parser_Block[] */ function parse( $document ) { $this->document = $document; @@ -394,6 +395,7 @@ class WP_Block_Parser { * * @internal * @since 5.0.0 + * @since 4.6.1 fixed a bug in attribute parsing which caused catastrophic backtracking on invalid block comments * @return array */ function next_token() { @@ -466,7 +468,7 @@ class WP_Block_Parser { * Returns a new block object for freeform HTML * * @internal - * @since 5.0.0 + * @since 3.9.0 * * @param string $innerHTML HTML content of block. * @return WP_Block_Parser_Block freeform block object.