Changes for page HTMLConverter

Last modified by Ricardo Julio Rodríguez Fernández on 2024/06/27 11:39

From version 2.1
edited by Ricardo Julio Rodríguez Fernández
on 2024/06/27 11:39
Change comment: Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/16.5.0]
To version 1.1
edited by Ricardo Julio Rodríguez Fernández
on 2023/10/05 12:17
Change comment: Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/15.8]

Summary

Details

Page properties
Content
... ... @@ -7,7 +7,20 @@
7 7   #set ($text = "$!request.text")
8 8   #set ($stripHTMLEnvelope = $request.stripHTMLEnvelope == 'true')
9 9   #set ($output = "#ckeditor_convert($text $toHTML $fromHTML $stripHTMLEnvelope)")
10 - #rawResponse($output)
10 + #set ($characterEncoding = 'utf-8')
11 + ## Make sure the Character Encoding response header matches the character encoding used to write the response and
12 + ## compute its length. See CKEDITOR-162: Cannot convert to source code
13 + #set ($discard = $response.setCharacterEncoding($characterEncoding))
14 + ## We write the output directly to the response to avoid the execution of the Rendering Transformations. Another
15 + ## option would be to specify which Rendering Transformations to execute in the query string (XWIKI-13167).
16 + ## See CKEDITOR-51: Icon transformations are saved by CKEditor
17 + #set ($discard = $response.writer.print($output))
18 + ## The content length is measured in bytes and one character can use more than one byte.
19 + #set ($discard = $response.setContentLength($output.getBytes($characterEncoding).size()))
20 + ## Make sure the entire content is send back to the client.
21 + #set ($discard = $response.flushBuffer())
22 + ## Make sure XWiki doesn't write any more content to the response.
23 + #set ($discard = $xcontext.setFinished(true))
11 11  #else
12 12   The service used by the CKEditor source plugin to convert between HTML and wiki syntax.
13 13  #end