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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant