[wp-trac] [WordPress Trac] #40951: New Text Widget - Switching Between Visual/Text Editor Strips Out Code

WordPress Trac noreply at wordpress.org
Thu Jun 8 17:07:42 UTC 2017


#40951: New Text Widget - Switching Between Visual/Text Editor Strips Out Code
--------------------------+------------------------------
 Reporter:  dwrippe       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Widgets       |     Version:  4.8
 Severity:  minor         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by dwrippe):

 @westonruter Playing with it some more, it only appears to happen with
 certain elements. For example, empty <a> and <span> elements disappear,
 while empty <div> elements do not. I haven't had time to run through the
 gamut of different HTML elements.

 I don't really have a problem with the new functionality (there are ways
 around it, like dumping in text and using CSS to set the font-size to
 zero), but what concerns me is existing solutions. Say, for example, I
 have put a linked map in a widget space that is styled and displayed
 exclusively via CSS. If the code is something as simple as <a href="#"
 class="map"></a>, that is going to disappear the next time I (or a client)
 modifies and saves that Text widget.

 I should point out that the Text widget is NOT modified unless you
 actually re-save the contents. I first discovered the initial example when
 trying to figure out how I'd linked the List items, because I didn't see
 <a> tags in the text widget. The links still worked on the front-end. Upon
 saving the Text widget, the links on the front-end stopped working, which
 alerted me to what had happened (if that makes sense).

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


More information about the wp-trac mailing list