[wp-trac] [WordPress Trac] #31219: Divs get collapsed always since nbsp is not added.

WordPress Trac noreply at wordpress.org
Tue May 5 18:09:57 UTC 2015


#31219: Divs get collapsed always since nbsp is not added.
--------------------------+------------------------------
 Reporter:  programmin    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  TinyMCE       |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by boonebgorges):

 To clarify the original bug report a bit more:

 1. In Text mode, enter `<div>foo bar</div>`
 2. Switch to Visual mode
 3. Put the cursor between 'foo' and 'bar' and hit enter a few times
 4. Switching back to Text mode, you'll see that empty `<div></div>`
 elements have been created
 5. When publishing, the empty divs are stripped.

 The suggestion made by programmin (awesome screenname, btw) is that these
 empty `<div>` elements ought to have some content in them so that they're
 not removed: `<div> </div>`. The consensus in the bug scrub was that
 this seems like very odd behavior.

 So, the question is: what is the expected behavior here? Should we be
 creating the dummy divs? Should we be creating `<p>`s instead (and would
 that cause the same problem)? Maybe `<br />` elements?

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


More information about the wp-trac mailing list