Author: jalkanen
Date: Thu Feb 14 14:22:22 2008
New Revision: 627895
URL: http://svn.apache.org/viewvc?rev=627895&view=rev
Log:
JSPWIKI-171: No longer shows null preview with FCK.
Modified:
incubator/jspwiki/trunk/src/webdocs/Comment.jsp
Modified: incubator/jspwiki/trunk/src/webdocs/Comment.jsp
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/webdocs/Comment.jsp?rev=627895&r1=627894&r2=627895&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/webdocs/Comment.jsp (original)
+++ incubator/jspwiki/trunk/src/webdocs/Comment.jsp Thu Feb 14 14:22:22 2008
@@ -223,7 +223,19 @@
else if( preview != null )
{
log.debug("Previewing "+pagereq);
- session.setAttribute(EditorManager.REQ_EDITEDTEXT,
EditorManager.getEditedText(pageContext));
+
+ String commentText = EditorManager.getEditedText(pageContext);
+
+ //
+ // WYSIWYG editor sends us its greetings
+ //
+ String htmlText = findParam( pageContext, "htmlPageText" );
+ if( htmlText != null && cancel == null )
+ {
+ commentText = new
HtmlStringToWikiTranslator().translate(htmlText,wikiContext);
+ }
+
+ session.setAttribute(EditorManager.REQ_EDITEDTEXT, commentText);
response.sendRedirect( TextUtil.replaceString(
wiki.getURL(WikiContext.PREVIEW, pagereq, "action=comment", false),"&","&")
);
return;
}