[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 10:26:51 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 diegocanal):

 Replying to [comment:7 hlashbrooke]:
 > I was just pointing out that it isn't generally accepted in HTML
 practice, even if it is permissible.

 I couldn't disagree more with you. FYI, '''nesting block elements such as
 {{{div}}} and headings ({{{h1}}}, {{{h2}}}, etc) inside the {{{a}}}
 element (links) has been widely used [http://html5doctor.com/block-level-
 links-in-html-5/ since 2009]'''. Here you have some examples I found in
 very well known sites:
 * [https://www.apple.com/ Apple] (look at the 4 blocks below the slider)
 * [https://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dgarden
 &field-keywords=html5+beginners Amazon] (towards the bottom look at "Your
 recently viewed items and featured recommendations" section items)
 * [https://cloud.google.com/products/ Google] (all over the page)

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


More information about the wp-trac mailing list