Tinymce remove empty element when removing backspace in editor

TinyMCE removes empty item element when backspace is removed in editor. The element is used for styling. The problem occurs in Firefox, not when using Chrome.

Steps to reproduce: 1. go to http://fiddle.tinymce.com/P0eaab (config adapted so that class information is not cleared) 2.click on the menu bar "Tools" and then "Source Code" 3. paste the following html code

<div class="eight columns row">
<h2>Tarieven seizoensopening 2014</h2>
Prijs per persoon per nacht met inbegrip van een uitgebreid ontbijt en  avonds een culinair driegangenmenu (apero-wijn-water-koffie):
<ul class="list unstyled-list">
<li><i class="small-arrows"></i>Kamer 1: 125 &euro; ppppn*</li>
<li><i class="small-arrows"></i>Kamer 2: 115 &euro; ppppn*</li>
<li><i class="small-arrows"></i>Kamer 3: 115 &euro; ppppn*</li>
<li><i class="small-arrows"></i>Kamer 4: 100 &euro; ppppn*</li>
</ul>
</div>

      

  1. Click OK
  2. Place the cursor in the editor window just behind "5" to "125"
  3. Hold backspace so that "125" is changed to "12"
  4. Click on "Tools" in the menu bar, then on "Source Code"

Expected result (only snippet with the problem shown):

<li><i class="small-arrows">Kamer 1: 12 &euro; ppppn*</li>
<li><i class="small-arrows"></i>Kamer 2: 115 &euro; ppppn*</li>

      

Actual result (only snippet with the problem shown):

<li>Kamer 1: 12 &euro; ppppn*</li>
<li><i class="small-arrows"></i>Kamer 2: 115 &euro; ppppn*</li>

      

Additional notes: - somehow the backspace cleared "" on the first li element - doing the same experiment in chrome does not result in an error - all plugins in FireFox were disabled in this test to avoid any interference - Is there a way to find out if what causes this element i to be removed? Can you actually use a debugger that shows a live javascript action. I have Firebug but can't see how I can see javascript live in action

+3


source to share


1 answer


This is an old question, but maybe it will be useful for someone. You need to add the following setting in tinyMCE config

extended_valid_elements:'i[*]'

      



I will only help for the "i" tag. So if you have other empry tags you need to add it here too.

0


source







All Articles