Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
#############################################################################
SELECTIVE EXCLUSIONS
Exclude specific files for specific sniffs and/or exclude sub-groups in sniffs.

These exclusions are listed ordered by alphabetic sniff name.
#############################################################################
-->
Expand Down Expand Up @@ -266,8 +266,9 @@

<!-- Goto is an effective way to handle errors in decoders which expect valid bytes
without impacting the fast path while avoiding bloating the code with redundant
and risky handling code. Exclude forbidding goto in UTF-8 fallback code. -->
and risky handling code. Exclude forbidding goto in parser code. -->
<exclude-pattern>/wp-includes/compat-utf8\.php</exclude-pattern>
<exclude-pattern>/wp-includes/class-wp-block-processor\.php</exclude-pattern>
</rule>

<!-- Exclude sample config from modernization to prevent breaking CI workflows based on WP-CLI scaffold.
Expand Down
11 changes: 11 additions & 0 deletions src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,17 @@ function render_block( $parsed_block ) {
/**
* Parses blocks out of a content string.
*
* Given an HTML document, this function fully-parses block content, producing
* a tree of blocks and their contents, as well as top-level non-block content,
* which will appear as a block with no `blockName`.
*
* This function can be memory heavy for certain documents, particularly those
* with deeply-nested blocks or blocks with extensive attribute values. Further,
* this function must parse an entire document in one atomic operation.
*
* If the entire parsed document is not necessary, consider using {@see WP_Block_Processor}
* instead, as it provides a streaming and low-overhead interface for finding blocks.
*
* @since 5.0.0
*
* @param string $content Post content.
Expand Down
Loading
Loading