[wp-trac] [WordPress Trac] #38055: <a href> tags disappear when switching from "Text" view to "Visual" view of Page Editor

WordPress Trac noreply at wordpress.org
Thu Jul 11 05:49:31 UTC 2019


#38055: <a href> tags disappear when switching from "Text" view to "Visual" view of
Page Editor
--------------------------+----------------------
 Reporter:  chrisrelish   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Editor        |     Version:  4.6.1
 Severity:  normal        |  Resolution:  wontfix
 Keywords:                |     Focuses:
--------------------------+----------------------
Changes (by pento):

 * status:  new => closed
 * resolution:   => wontfix
 * milestone:  Awaiting Review =>


Comment:

 I agree that `<a href="..."><div>...</div></a>` is valid HTML5.
 Unfortunately, due to the nature of `wpautop()`, I don't think it's
 possible to add support for this use case. Particularly with the
 introduction of the block editor (which deprecates the classic editor and
 `wpautop()`), it's unlikely that this issue will be addressed.

 For the second case of `<a href="..."></a><div>...</div>`, this is
 intended behaviour by the classic editor. Empty inline tags will be
 automatically removed. To prevent this, I recommend putting a ` `
 character inside the tag.

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


More information about the wp-trac mailing list