Skip to content

Strip leading/trailing whitespace whitespace from interactive examples#1900

Open
jordikroon wants to merge 1 commit intophp:masterfrom
jordikroon:interactive-example/newline
Open

Strip leading/trailing whitespace whitespace from interactive examples#1900
jordikroon wants to merge 1 commit intophp:masterfrom
jordikroon:interactive-example/newline

Conversation

@jordikroon
Copy link
Copy Markdown
Member

@jordikroon jordikroon commented May 8, 2026

This should make interactive examples more in line with existing <screen> output. Resulting in less layout shifting when doing Run code.

Live action (Example #3 DateTimeInterface::diff() range):
https://www.php.net/manual/en/datetime.diff.php

It doesn't happen always. It depends on the output.

  • E.g var_dump(). Leading <br>
  • throw new Exception(). Trailing <br>
  • When manually given in examples. In <screen> output we don't usually do this.

Before:

image

After:
image

@jordikroon jordikroon force-pushed the interactive-example/newline branch from e39971d to 501a37a Compare May 8, 2026 17:19
@jordikroon jordikroon changed the title don't render extra whitespace in interactive examples Strip leading/trailing whitespace whitespace from interactive examples May 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

📊 Regression report for commit 501a37a is at https://web-php-regression-report-pr-1900.preview.thephp.foundation

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

🚀 Preview for commit 501a37a is available at https://web-php-pr-1900.preview.thephp.foundation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants