0

I'm using TinyMCE 3.x and can't find the documentation for a problem I'm having.

If I use the html editor to add an empty element such as <div class="clearfix"></div> or <span class="clearfix"></span>, the editor removes these automatically.

Is there a way to tell it to stop stripping out empty elements?

I have found

extended_valid_elements :  "#div, #span",

which almost fixes it. If I enable this and add <div class="clearfix"></div>, it replaces it with <div>&nbsp;</div>, so adds a space but removes the class.

TH1981
  • 3,105
  • 7
  • 42
  • 78
  • hey, try `extended_valid_elements : "#div[class], #span[class]",` – Mario A Dec 29 '15 at 22:09
  • that seems to have done it. I've added `[class|id]` and that seems to be working. Unfortunately, I'm having to use the way back machine to get the documentation for 3.x! >.< if you add the answer, I'll give you the credit :) – TH1981 Dec 29 '15 at 22:13

1 Answers1

0

the class attribute seems to get stripped out, so try to make it valid like this:

extended_valid_elements : "#div[class], #span[class]"
Mario A
  • 3,286
  • 1
  • 17
  • 22