-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Converting a <pre> to blocks drops new lines #12109
Copy link
Copy link
Closed
Labels
[Block] ClassicAffects the Classic Editor BlockAffects the Classic Editor Block[Feature] Block TransformsBlock transforms from one block to anotherBlock transforms from one block to another[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Milestone
Metadata
Metadata
Assignees
Labels
[Block] ClassicAffects the Classic Editor BlockAffects the Classic Editor Block[Feature] Block TransformsBlock transforms from one block to anotherBlock transforms from one block to another[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.
If you open an old post in Gutenberg it will put the contents in a classic block. If this classic block contains a
<pre>section and you then convert that to blocks it removes the new lines in the editor.HTML is:
From the block options pick 'convert to blocks' and get:
Note that this is only in the Gutenberg editor, where the code is:
When viewed in the post the
<pre>is correct:Expected behavior
Either the
<pre>conversion should add the<br/>tags that occur when created in Gutenberg, or the preformatted block should insert breaks in the display when a new line is encountered.