[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
Wed Jul 19 19:06:01 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
Component:  Formatting                           |  Review
 Severity:  normal                               |     Version:
 Keywords:  needs-patch needs-unit-tests 2nd-    |  Resolution:
  opinion                                        |     Focuses:
-------------------------------------------------+-------------------------

Comment (by diegocanal):

 Replying to [comment:15 afercia]:
 > Worth noting
 > `<a href="https://example.com/"><div>DIV inside link</div></a>`
 > is valid in HTML5. However, WordPress shouldn't assume all the themes
 use HTML5 as this would be invalid in HTML 4.0.1.

 You are right pointing out that this kind of structures would not be valid
 in HTML 4.0.1 but...'''even if a developer made a mistake using invalid
 code (in HTML 4.0.1), how would it help having {{{wpautop}}} messing up
 the code? The way {{{wpautop}}} works now, it outputs invalid code for
 both standards, HTML5 and HTML 4.0.1.''' Sorry, I think I'm missing the
 point.

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


More information about the wp-trac mailing list