There are 3 updates, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-683c079f-2ac8-4292-a517-a5a75251f36f XWIKI-24010 Closed

Inconsistent escapes in the $services.localization.render method

 
View issue   ยท   Add comment
 

3 updates

 
cid:jira-generated-image-avatar-524c19ac-d6ae-4ccc-9f1d-0cd2a904d081 Changes by Thomas Mortagne on 12/Feb/26 15:53
 
Assignee: Thomas Mortagne
Resolution: Won't Fix
Status: Open Closed
 
 

1 comment

 
cid:jira-generated-image-avatar-524c19ac-d6ae-4ccc-9f1d-0cd2a904d081 Thomas Mortagne on 12/Feb/26 15:53
 
bq. I'm not sure if that was a good assumption.

It was not :)

Those are two different things. The point of {{$services.localization.render}} is to serialize the blocks representing the translation (which might contain other stuff than plain text in theory) into the passed syntax. As such, it's escaping only what is supposed to be escaped, exactly like when the content of the WYSIWYG is serialized.

{{$services.rendering.escape}}'s goal is different: the point is to make sure that nothing is interpreted in a String passed to it, no matter what. And the fastest and safest way to do that is to not try to be clever and escape every character, even if most of them
to don't need to be.