[wp-trac] [WordPress Trac] #51302: Lots of newlines in REST API rendered content when using block editor

WordPress Trac noreply at wordpress.org
Sun Sep 13 21:22:18 UTC 2020


#51302: Lots of newlines in REST API rendered content when using block editor
--------------------------+-----------------------------
 Reporter:  rmens         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  5.5.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In a post created with the block editor i have the following

 {{{
 <!-- wp:paragraph -->
 <p>This is paragraph 1</p>
 <!-- /wp:paragraph -->

 <!-- wp:paragraph -->
 <p>This is paragraph 2</p>
 <!-- /wp:paragraph -->
 }}}

 But the REST API renders the content as

 {{{
 "\n<p>This is paragraph 1</p>\n\n\n\n<p>This is paragraph 2</p>\n"
 }}}

 There seem to be 4 newlines between the paragraphs, while there should
 only be one. When I make the same post in the classic editor, it comes out
 like this. Which looks more correct.

 {{{
 "<p>This is paragraph 1</p>\n<p>This is paragraph 2</p>\n"
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51302>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list