Skip to content
Merged
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
3 changes: 3 additions & 0 deletions e2e/fixtures/wxr-simple.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
<p>Two roads diverged in a yellow wood,<br>And sorry I could not travel both</p>
<!-- /wp:paragraph -->

<!-- Test if self-closing blocks remain self-closing after URL rewriting. -->
<!-- wp:navigation-link {"url":"https://playground.internal/path/one"} /-->

<!-- wp:paragraph -->
<p>
<a href="https://playground.internal/path/one">One</a> seemed great, but <a href="https://playground.internal/path-not-taken">the other</a> seemed great too.
Expand Down
6 changes: 6 additions & 0 deletions e2e/import-wxr.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ PARSERS.forEach((parser) => {
<p>Two roads diverged in a yellow wood,<br>And sorry I could not travel both</p>
<!-- /wp:paragraph -->

<!-- Test if self-closing blocks remain self-closing after URL rewriting. -->
<!-- wp:navigation-link {"url":"${PLAYGROUND_URL}/one"} /-->

<!-- wp:paragraph -->
<p>
<a href="${PLAYGROUND_URL}/one">One</a> seemed great, but <a href="https://playground.internal/path-not-taken">the other</a> seemed great too.
Expand Down Expand Up @@ -213,6 +216,9 @@ test.describe('General tests', () => {
<p>Two roads diverged in a yellow wood,<br>And sorry I could not travel both</p>
<!-- /wp:paragraph -->

<!-- Test if self-closing blocks remain self-closing after URL rewriting. -->
<!-- wp:navigation-link {\"url\":\"https://playground.internal/path/one\"} /-->

<!-- wp:paragraph -->
<p>
<a href="https://playground.internal/path/one">One</a> seemed great, but <a href="https://playground.internal/path-not-taken">the other</a> seemed great too.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ private function block_attribute_updates_to_modifiable_text_updates() {
' ' .
$this->block_name .
' ' .
$encoded_attributes
$encoded_attributes .
( $this->is_self_closing_block() ? '/' : '' )
);

return true;
Expand Down