-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
Backwards CompatibilityIssues or PRs that impact backwards compatabilityIssues or PRs that impact backwards compatability[Feature] Document SettingsDocument settings experienceDocument settings experience[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Line breaks are handled differently in Gutenberg blocks vs classic blocks
When generating excerpts, Wordpress 5.x strips out the <br>
tags in Gutenberg blocks, but it replaces them with a normal space (” “) in Classic blocks.
To reproduce
- Create a post in WordPress using the Gutenberg editor.
- Type some text in the first block and insert line breaks using Shift-Enter (or
in the code editor) - Save the post as a draft.
- Create a post with the same text using the Classic editor.
- Save the post as a draft.
- Compare the excerpts using the expanded view in the Wordpress list of all posts. This behavior can also be seen in other places where excerpts are used.
Expected behavior
Line breaks (with <br>
) should always be replaced with a normal space (" ") in excerpts.
Screenshots
Compare "This is just to say 1" (classic block) with "This is just to say 2" (Gutenberg "paragraph" block).
Desktop (please complete the following information):
n/a
Smartphone (please complete the following information):
n/a
Additional context
- WordPress 5.1
- Please add the version of Gutenberg you are using in the description.
- To report a security issue, please visit the WordPress HackerOne program: https://hackerone.com/wordpress.
lkraav
Metadata
Metadata
Assignees
Labels
Backwards CompatibilityIssues or PRs that impact backwards compatabilityIssues or PRs that impact backwards compatability[Feature] Document SettingsDocument settings experienceDocument settings experience[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended