core/modules/big_pipe/src/Render/BigPipe.php | 8 ++++---- .../src/Render/Placeholder/BigPipeStrategy.php | 4 ++-- .../src/Tests/BigPipePlaceholderTestCases.php | 24 +++++++++++----------- core/modules/big_pipe/src/Tests/BigPipeTest.php | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/modules/big_pipe/src/Render/BigPipe.php b/core/modules/big_pipe/src/Render/BigPipe.php index 976d622..89d4ee1 100644 --- a/core/modules/big_pipe/src/Render/BigPipe.php +++ b/core/modules/big_pipe/src/Render/BigPipe.php @@ -70,7 +70,7 @@ * 1. BigPipe placeholders: 1 HtmlResponse + N embedded AjaxResponses. * - Before a BigPipe response is sent, it is just a HTML response that * contains BigPipe placeholders. Those placeholders look like - *
. JavaScript is used to + * . JavaScript is used to * replace those placeholders. * Therefore these placeholders are actually sent to the client. * - The Skeleton of course has attachments, including most notably asset @@ -97,7 +97,7 @@ * - Before a BigPipe response is sent, it is just a HTML response that * contains no-JS BigPipe placeholders. Those placeholders can take two * different forms: - * 1.
if it's a + * 1. if it's a * placeholder that will be replaced by HTML * 2. big_pipe_nojs_placeholder_attribute_safe:… if it's a placeholder * inside a HTML attribute, in which 1. would be invalid (angle brackets @@ -714,12 +714,12 @@ protected function renderPlaceholder($placeholder, array $placeholder_render_arr * only keep the first occurrence. */ protected function getPlaceholderOrder($html, $placeholders) { - $fragments = explode('
', $fragment, 2); + $t = explode('">', $fragment, 2); $placeholder_id = $t[0]; $placeholder_ids[] = $placeholder_id; } diff --git a/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php b/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php index 46a20c6..f967eba 100644 --- a/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php +++ b/core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php @@ -199,7 +199,7 @@ protected static function createBigPipeJsPlaceholder($original_placeholder, arra $big_pipe_placeholder_id = static::generateBigPipePlaceholderId($original_placeholder, $placeholder_render_array); return [ - '#markup' => '
', + '#markup' => '', '#cache' => [ 'max-age' => 0, 'contexts' => [ @@ -237,7 +237,7 @@ protected static function createBigPipeJsPlaceholder($original_placeholder, arra */ protected static function createBigPipeNoJsPlaceholder($original_placeholder, array $placeholder_render_array, $placeholder_must_be_attribute_safe = FALSE) { if (!$placeholder_must_be_attribute_safe) { - $big_pipe_placeholder = '
'; + $big_pipe_placeholder = ''; } else { $big_pipe_placeholder = 'big_pipe_nojs_placeholder_attribute_safe:' . Html::escape($original_placeholder); diff --git a/core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php b/core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php index 0a674e0..69ec86f 100644 --- a/core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php +++ b/core/modules/big_pipe/src/Tests/BigPipePlaceholderTestCases.php @@ -61,7 +61,7 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ); $status_messages->bigPipePlaceholderId = 'callback=Drupal%5CCore%5CRender%5CElement%5CStatusMessages%3A%3ArenderMessages&args[0]&token=_HAdUpwWmet0TOTe2PSiJuMntExoshbm1kh2wQzzzAA'; $status_messages->bigPipePlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'library' => ['big_pipe/big_pipe'], @@ -75,13 +75,13 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ], ], ]; - $status_messages->bigPipeNoJsPlaceholder = '
'; + $status_messages->bigPipeNoJsPlaceholder = ''; $status_messages->bigPipeNoJsPlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'big_pipe_nojs_placeholders' => [ - '
' => $status_messages->placeholderRenderArray, + '' => $status_messages->placeholderRenderArray, ], ], ]; @@ -225,7 +225,7 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ); $current_time->bigPipePlaceholderId = 'timecurrent-timetime'; $current_time->bigPipePlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'library' => ['big_pipe/big_pipe'], @@ -248,13 +248,13 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf 'settings' => NULL, ], ]; - $current_time->bigPipeNoJsPlaceholder = '
'; + $current_time->bigPipeNoJsPlaceholder = ''; $current_time->bigPipeNoJsPlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'big_pipe_nojs_placeholders' => [ - '
' => $current_time->placeholderRenderArray, + '' => $current_time->placeholderRenderArray, ], ], ]; @@ -274,7 +274,7 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ); $exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3Aexception&args[0]=llamas&args[1]=suck&token=uhKFNfT4eF449_W-kDQX8E5z4yHyt0-nSHUlwaGAQeU'; $exception->bigPipePlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'library' => ['big_pipe/big_pipe'], @@ -289,7 +289,7 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ], ]; $exception->embeddedAjaxResponseCommands = NULL; - $exception->bigPipeNoJsPlaceholder = '
'; + $exception->bigPipeNoJsPlaceholder = ''; $exception->bigPipeNoJsPlaceholderRenderArray = [ '#markup' => $exception->bigPipeNoJsPlaceholder, '#cache' => $cacheability_depends_on_session_and_nojs_cookie, @@ -314,7 +314,7 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ); $embedded_response_exception->bigPipePlaceholderId = 'callback=%5CDrupal%5Cbig_pipe_test%5CBigPipeTestController%3A%3AresponseException&&token=PxOHfS_QL-T01NjBgu7Z7I04tIwMp6La5vM-mVxezbU'; $embedded_response_exception->bigPipePlaceholderRenderArray = [ - '#markup' => '
', + '#markup' => '', '#cache' => $cacheability_depends_on_session_and_nojs_cookie, '#attached' => [ 'library' => ['big_pipe/big_pipe'], @@ -329,7 +329,7 @@ public static function cases(ContainerInterface $container = NULL, AccountInterf ], ]; $embedded_response_exception->embeddedAjaxResponseCommands = NULL; - $embedded_response_exception->bigPipeNoJsPlaceholder = '
'; + $embedded_response_exception->bigPipeNoJsPlaceholder = ''; $embedded_response_exception->bigPipeNoJsPlaceholderRenderArray = [ '#markup' => $embedded_response_exception->bigPipeNoJsPlaceholder, '#cache' => $cacheability_depends_on_session_and_nojs_cookie, diff --git a/core/modules/big_pipe/src/Tests/BigPipeTest.php b/core/modules/big_pipe/src/Tests/BigPipeTest.php index 25a59b0..9d2b257 100644 --- a/core/modules/big_pipe/src/Tests/BigPipeTest.php +++ b/core/modules/big_pipe/src/Tests/BigPipeTest.php @@ -357,7 +357,7 @@ protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholde foreach ($expected_big_pipe_placeholders as $big_pipe_placeholder_id => $expected_ajax_response) { $this->pass('BigPipe placeholder: ' . $big_pipe_placeholder_id, 'Debug'); // Verify expected placeholder. - $expected_placeholder_html = '
'; + $expected_placeholder_html = ''; $this->assertRaw($expected_placeholder_html, 'BigPipe placeholder for placeholder ID "' . $big_pipe_placeholder_id . '" found.'); $pos = strpos($this->getRawContent(), $expected_placeholder_html); $placeholder_positions[$pos] = $big_pipe_placeholder_id;