Item1798: Wysiwyg editor again adds newlines where it should not

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Extension TinyMCEPlugin  
After having tested the trunk version of Wysiwyg / TinyMCE for 10 minutes I have found that the old newline bugs are back again.

The first is that newline is added after a table row.

This example

%TABLE{columnwidths="65%"}%
| *Headline* | *Submitted By* | *Age* | *Last Change* |
%SEARCH{ "BugStatus = 'New'" casesensitive="on" type="query" nosearch="on" order="modified" reverse="on" excludetopic="BugReportTemplate" format="| [[$topic][$formfield(TopicTitle)]]| $formfield(SubmittedBy) | $percntCALC{$ROUND($TIMEDIFF($TIME($createdate), $TODAY(), days)+1,0)}$percnt | $date<br /> $wikiusername |"}%

is the first I bump into.

After an edit / save cycle it becomes

%TABLE{columnwidths="65%"}%
| *Headline* | *Submitted By* | *Age* | *Last Change* |

%SEARCH{ "BugStatus = 'New'" casesensitive="on" type="query" nosearch="on" order="modified" reverse="on" excludetopic="BugReportTemplate" format="| [[$topic][$formfield(TopicTitle)]]| $formfield(SubmittedBy) | $percntCALC{$ROUND($TIMEDIFF($TIME($createdate), $TODAY(), days)+1,0)}$percnt | $date<br /> $wikiusername |"}%

which naturally destroys the table.

The editor must not add or remove any newlines anywhere.

-- KennethLavrsen - 04 Jul 2009

Confirmed. I added a WysiwygPlugin unit test for this case, and it passes. This means that the problem is not WysiwygPlugin in isolation, if WysiwygPlugin is involved at all.

I did see something that might be invalid HTML. If I edit the topic, click Wikitext, remove the blank line so that the %SEARCH is on the next line after the table (as it is supposed to be) and then click WYSIWYG, the REST response includes this:
</table>
<span class="WYSIWYG_PROTECTED"><br />%SEARCH{

If I then click HTML, I see that something (either TMCE or the browser) added an extra <p> between the </table> and the <span>, like this:
</table>
<p><span class="WYSIWYG_PROTECTED"><br />%SEARCH{

If I try to remove the <p> in the HTML editor, something puts it back (probably the same thing that put it there in the first place).

If I edit the HTML and merge the <p> and <span>, like this:
</table>
<p class="WYSIWYG_PROTECTED"><br />%SEARCH{
... and then click Wikitext, there is still an extra blank line.

If I edit the HTML and replace the <p> and <span> with a <div>, like this:
</table>
<div class="WYSIWYG_PROTECTED"><br />%SEARCH{
... and then click Wikitext, then the extra blank link is still there.

But, if I remove the <p> and put a <div> around the table and the line that follows it, like this:
<div>
<table
... table code here ...
</table>
<span class="WYSIWYG_PROTECTED"><br />%SEARCH{
... and then click Wikitext, then the blank line is not there.

-- MichaelTempest - 04 Jul 2009

TMCE is adding the <p> tag - the forced_root_block option defaults to true in TMCE 3.0a1. This change was apparently made so that TMCE will produce valid XHTML.

Sure enough, if I add forced_root_block: "" to TINYMCEPLUGIN_INIT, TMCE no longer adds the <p> tag. I have not yet checked to see what other impact there is from setting forced_root_blocks.

Crawford said that TMCE should not add the <p> tags.

My gut feel is that this option should be fine because it makes TMCE behave more like the previous version, where it did not add these tags.

-- MichaelTempest - 30 Jul 2009

Changing component to TinyMCEPlugin.

-- MichaelTempest - 30 Jul 2009

ItemTemplate edit

Summary Wysiwyg editor again adds newlines where it should not
ReportedBy KennethLavrsen
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component TinyMCEPlugin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins Foswikirev:4434 Foswikirev:4583 Foswikirev:4586
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r10 - 31 Jul 2009, MichaelTempest
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License