Best practice forum (Archived)

HTML/WSIWYG editor ERRORS when Changes Saved

 
? ?
HTML/WSIWYG editor ERRORS when Changes Saved
de ? ? - Monday, 2 de May de 2011, 23:02
 

The more I try to refine and customise my pages using the HTML/WSIWYG editor I am increasingly finding it almost unsuable for the course layout we want.

Even after updating in HTML mode, once i click Save Changes the editor seems to:

1. add in extra characters:

<script type="text/javascript">// <![CDATA[
&#010;&#010;Shadowbox.init()&#010;&#010;
// ]]></script>

2. removes empty <div> tags:

<div style="background-color:blue;height:3px;"></div>

3. removes emptty <p> tags or line breaks

<h1> heading 1 </h1>

<br>

<br>

<br>

<h2> heading 2 </h2>

becomes

<h1> heading 1 </h1>

<h2> heading 2 </h2>


I don't understand what's changed between using Totara 1.0.3 - 10.0.7

Simon Coggins
Re: HTML/WSIWYG editor ERRORS when Changes Saved
de Simon Coggins - Tuesday, 3 de May de 2011, 14:30
Grupo Totara

Hi Ira,

The first of those issues is normal behaviour (for XHTML compliance) and shouldn't impact on your script. See here for more details:

http://stackoverflow.com/questions/66837/when-is-a-cdata-section-necessary-within-a-script-tag

The other two definitely seem to be bugs. What happened between 1.0.3 and 1.0.7 is that we upgraded the HTML editor to a more recent version (the editor is actually called TinyMCE and is third party code that we have integrated into Totara):

http://tinymce.moxiecode.com/

This upgrade fixed some known bugs, but seems to have changed its behaviour regarding empty elements. There are some other people posting about this issue along with some possible configuration fixes that I'll look into:

http://modxcms.com/forums/index.php?topic=42242.0

http://tinymce.moxiecode.com/forum/viewtopic.php?id=13329

The 'quick' fix is to always put at least a space in any <p> element. For the empty DIV, a space didn't work for me but a 'none-breaking' space did:

<div style="background-color: blue; height: 3px;">&nbsp;</div>

Sorry for the trouble this has caused you, hopefully we'll have a fix soon.

Simon

? ?
Re: HTML/WSIWYG editor ERRORS when Changes Saved
de ? ? - Wednesday, 4 de May de 2011, 21:36
 

thanks for that explanation.

good to know it's not Totara itself, but rather the HTML editor.

Esta publicación en el foro ha sido eliminada.
Wednesday, 4 de May de 2011, 19:41
El contenido de esta publicación del foro se ha eliminado y ya no se puede acceder a él.
? ?
Re: HTML/WSIWYG editor ERRORS when Changes Saved
de ? ? - Thursday, 5 de May de 2011, 17:10
 

i'll use the workaround for now with the &nbsp; until the update is released.

thanks for addressing this

Simon Coggins
Re: HTML/WSIWYG editor ERRORS when Changes Saved
de Simon Coggins - Monday, 9 de May de 2011, 21:49
Grupo Totara

As promise this fix made it into version 1.0.10 released today (10th May).

Simon