[wp-trac] [WordPress Trac] #39324: code tags are incorrectly surrounded by paragraph tags on HTML render, breaking rendering on RSS

WordPress Trac noreply at wordpress.org
Tue Dec 20 04:41:51 UTC 2016


#39324: code tags are incorrectly surrounded by paragraph tags on HTML render,
breaking rendering on RSS
--------------------------+------------------------------
 Reporter:  jmountbug     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:  4.7
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:  template
--------------------------+------------------------------
Changes (by azaozz):

 * keywords:   => close


Comment:

 From the examples post:
 > `<code>y</code>` is rendered as `<p><code>y</code></p>`

 Yes, this is the correct behavior.

 > `<code><pre>x</pre></code>` is "broken"

 This happens because `<code>` is an "inline" tag, like `<strong>` and
 `<em>`. It cannot contain "block" tags like `<pre>`, and it needs to be
 inside a paragraph in the editor, like any other text.

 Proper use would be either `text <code>code example</code> text` or
 `<pre><code>code example</code></pre>`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39324#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list