Best practice forum (Archived)

HTML/WSIWYG editor ERRORS when Changes Saved

 
??
HTML/WSIWYG editor ERRORS when Changes Saved
?? 发表于 2011年05月2日 Monday 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

CogginsSimon
Re: HTML/WSIWYG editor ERRORS when Changes Saved
CogginsSimon 发表于 2011年05月3日 Tuesday 14:30
小组 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
?? 发表于 2011年05月4日 Wednesday 21:36
 

thanks for that explanation.

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

该论坛帖子已被删除
2011年05月4日 Wednesday 19:41
该论坛帖子的内容已被删除,无法再访问。
??
Re: HTML/WSIWYG editor ERRORS when Changes Saved
?? 发表于 2011年05月5日 Thursday 17:10
 

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

thanks for addressing this

CogginsSimon
Re: HTML/WSIWYG editor ERRORS when Changes Saved
CogginsSimon 发表于 2011年05月9日 Monday 21:49
小组 Totara

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

Simon