## Make sure the XWiki velocity variables are defined when the edited content is rendered. #template("xwikivars.vm") WYSIWYG Editor Input Template ## Include the stylesheets that affect the content in view mode. #template("stylesheets.vm") ## RichTextArea.css overwrites those CSS rules defined in the previous stylesheets that are improper in edit mode. #if ($request.method.equalsIgnoreCase('post') && $services.csrf.isTokenValid($request.token)) #set ($content = $NULL) #if ($request.key && $request.field) #set ($conversionFilterOutput = $request.session.getAttribute('com.xpn.xwiki.wysiwyg.server.converter.output')) #set ($content = $conversionFilterOutput.get($request.key).remove($request.field)) #end #if (!$content) #if ($request.getParameterMap().containsKey('source')) #set ($content = $services.wysiwyg.toAnnotatedXHTML($request.source, $tdoc.getSyntax().toIdString())) #elseif ($request.getParameterMap().containsKey('html')) #set ($content = $services.wysiwyg.parseAndRender($request.html, $tdoc.getSyntax().toIdString())) #end #end #end $!content