Anatoli,
I'm seeing the same issue (with embedded JavaScript) that Darryl described. This is with Confluence 2.10.1.
I have boiled down our more complicated page to a small page that shows the same issues. Here's the Wiki markup:
–
Rich Text Editor Eats JavaScript
If you edit this page using the Rich Text editor, the JavaScript calls appearing in the cells disappear (but not any straight HTML in the table). This used to work as one would expect in our old version of Confluence (that is, the JavaScript did not disappear). For a more complicated example of this (but with exactly the same problem), see [conflab:Test Copy of QA Portal].
{html}
<CENTER>
<SCRIPT language="javascript" type="text/javascript">
function writeToday() {
document.write(getToday());
}
function writeTomorrow() {
document.write(getTomorrow(getToday()));
}
function getToday() {
today = new Date().getDay();
if (today < 1 || today> 5) today = 5;
return today;
}
function getTomorrow(today) {
tomorrow = getToday() + 1;
if (tomorrow > 5) tomorrow = 1;
return tomorrow;
}
</SCRIPT>
<TABLE border="1" cellpadding="10" cellspacing="0">
<TBODY>
<TR>
<TD class><B><FONT color="#0000cc"></FONT></B>Hunter<BR></BR></TD>
<TD class>
<P><FONT color="#009900">Today</FONT><FONT color="#ff00cc"> </FONT></P></TD>
<TD class><FONT color="#009900">Tomorrow</FONT></TD>
</TR>
<TR>
<TD bgcolor="#dddddd" class><B><FONT color="#990000">***</FONT></B></TD>
<TD bgcolor="#ddffdd" class><FONT color="#ff0000">
<script>writeToday()</script>
<BR></BR></FONT></TD>
<TD bgcolor="#ddffdd" class><FONT color="#ff0000">
<script>writeTomorrow()</script>
<BR></BR></FONT></TD>
</TR>
</TABLE>
</CENTER>{html}
–
This page displays fine as long as you edit it with Wiki markup editor. If you select Rich Text, the JavaScript-generated portions disappear in the editor, and if you save it, you get <#comment> where there should be other text. The text and the JavaScript function definitions are still fine, but the resulting Wiki markup for the table is now:
–
- scripts are still intact, but the table is corrupted:
<TABLE border="1" cellpadding="10" cellspacing="0">
<TBODY>
<TR>
<TD class><B><FONT color="#0000cc"></FONT></B>Hunter<BR></BR><BR></BR></TD>
<TD class>
<P><FONT color="#009900">Today</FONT><FONT color="#ff00cc"> </FONT></P></TD>
<TD class><FONT color="#009900">Tomorrow</FONT></TD>
</TR>
<TR>
<TD bgcolor="#dddddd" class><B><FONT color="#990000">***</FONT></B></TD>
<TD bgcolor="#ddffdd" class><FONT color="#ff0000">
<MCE:SCRIPT type="text/javascript"><#comment></#comment></MCE:SCRIPT>
<BR></BR><BR></BR></FONT></TD>
<TD bgcolor="#ddffdd" class><FONT color="#ff0000">
<MCE:SCRIPT type="text/javascript"><#comment></#comment></MCE:SCRIPT>
<BR></BR><BR></BR></FONT></TD>
</TR>
</TBODY></TABLE>
</CENTER>
–
This seemed to work OK in an earlier version of Confluence that we were using, but not anymore with 2.10.1.
We've fixed this by changing the html macro so that it doesn't render the html in the Rich Text Editor ((see above). You can upgrade the html plugin to version 1.9 to get this fix immediately.