[wp-trac] [WordPress Trac] #40676: wpautop adds opening & closing p tags around the opening a tag and around the closing a tag when the link contains certain flow content elements like div, h1, h2...

WordPress Trac noreply at wordpress.org
Fri Jun 9 08:11:08 UTC 2017


#40676: wpautop adds opening & closing p tags around the opening a tag and around
the closing a tag when the link contains certain flow content elements like
div, h1, h2...
--------------------------+------------------------------
 Reporter:  diegocanal    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:  4.7.4
 Severity:  major         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by hlashbrooke):

 As a general HTML rule (regardless of whether it's WordPress or not),
 block level elements should never be wrapped inside inline elements. So a
 {{{div}}} or {{{h1}}} should ''never'' be placed inside an {{{a}}} tag. I
 imagine that is why {{{wpautop}}} handles things in this way, as you are
 going against the general HTML standards that are accepted all over the
 web.

 I'm not on the core team and don't have the requisite knowledge for
 patching this, but I don't think it really warrants a patch as this is not
 a bug, but rather an HTML standard that is being adhered to.

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


More information about the wp-trac mailing list