Best practice forum (Archived)

HTML/WSIWYG editor ERRORS when Changes Saved

 
? ?
HTML/WSIWYG editor ERRORS when Changes Saved
by ? ? - Monday, 2 May 2011, 11:02 PM
 

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
by Simon Coggins - Tuesday, 3 May 2011, 2:30 PM
Group 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
by ? ? - Wednesday, 4 May 2011, 9:36 PM
 

thanks for that explanation.

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

This forum post has been removed
Wednesday, 4 May 2011, 7:41 PM
The content of this forum post has been removed and can no longer be accessed.
? ?
Re: HTML/WSIWYG editor ERRORS when Changes Saved
by ? ? - Thursday, 5 May 2011, 5:10 PM
 

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
by Simon Coggins - Monday, 9 May 2011, 9:49 PM
Group Totara

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

Simon