This issue has been created
There are 3 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-28fc0185-faeb-45ec-912d-ca0a7d5d94eb XWIKI-24003 Open

Add a script service to execute rendering transformations

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-2af4bc1f-6e06-4cdd-a37d-e045d3bc075e Marius Dumitru Florea created this issue on 10/Feb/26 18:06
 
Summary: Add a script service to execute rendering transformations
Issue Type: cid:jira-generated-image-avatar-28fc0185-faeb-45ec-912d-ca0a7d5d94eb New Feature
Affects Versions: 18.0.1
Assignee: Unassigned
Components: Rendering - XWiki
Created: 10/Feb/26 18:06
Priority: cid:jira-generated-image-static-major-8d381c99-20dd-4e31-887e-2258d8e4a872 Major
Reporter: Marius Dumitru Florea
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.

 
 

3 updates

 
cid:jira-generated-image-avatar-2af4bc1f-6e06-4cdd-a37d-e045d3bc075e Changes by Marius Dumitru Florea on 10/Feb/26 18:06
 
Fix Version: 18.1.0-rc-1
Assignee: Marius Dumitru Florea
Tests: Unit