Details
-
New Feature
-
Resolution: Unresolved
-
Major
-
18.0.1
-
None
-
Unit
-
Unknown
-
Description
We already have a script service to parse and render the content. We're missing a script service to execute the rendering transformations. I would like to be able to do something like this:
#set ($targetSyntax = 'uniast/1.0') #set ($xdom = $services.rendering.parse($tdoc.content, $tdoc.syntax)) #set ($discard = $services.rendering.transform($xdom ).withSyntax($tdoc.syntax ).withTargetSyntax($targetSyntax ).withRestricted(true ).withTransformations(['macro'] ).withContentDocument($tdoc.documentReference ).execute()) #set ($renderedContent = $services.rendering.render($xdom, $targetSyntax))
See https://forum.xwiki.org/t/new-services-rendering-transform-api/18175 .
Note that this is needed for BlockNote integration, which uses the Edit Module, which allows having a template as the entry point for loading the editor. When loading the editor we need to "convert" the content of the edited document from the source syntax to the syntax supported by BlockNote (UniAst). We need to execute the rendering transformations when performing this conversion.
Attachments
Issue Links
- blocks
-
XWIKI-24004 Use directly the UniAst syntax instead of going through Markdown
-
- Open
-
- depends on
-
XRENDERING-803 Add support for overwriting the list of transformations to execute from the transformation context
-
- Open
-