Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.54
-
None
-
None
-
Unknown
-
Description
The problem can be reproduced with this code:
{{template name="display_macros.vm" /}} {{velocity}} {{html clean="false"}} #initRequiredSkinExtensions() $services.edit.syntaxContent.wysiwyg( 'one **two** three', $services.rendering.resolveSyntax('xwiki/2.1'), { 'id': 'description', 'name': 'description', 'rows': 25, 'cols': 80 } ) #getRequiredSkinExtensions($requiredSkinExtensions) #set ($discard = $response.setHeader('X-XWIKI-HTML-HEAD', $requiredSkinExtensions)) {{/html}} {{/velocity}}
If you check the response headers you'll see that the custom X-XWIKI-HTML-HEAD header is not set because the getRequiredSkinExtensions Velocity macro is overwritten by CKEditor.VelocityMacros, changing its behavior.
Ideally the edit module should isolate the Velocity namespace so that any macros defined by the rendered editor don't leak outside (are not accessible after the editor is rendered), but this is not easy to implement due to the way Velocity namespaces are implemented (only two levels, root and named, without support for inheritance). ATM a Velocity namespace is created and associated to each XWiki document. In our case we want to keep the current document but use a new namespace rather than the one already associated/created.
Attachments
Issue Links
- blocks
-
XWIKI-18841 The WYSIWYG editor doesn't always load when adding an annotation
- Closed