This issue is mainly a problem when we do copy/past of method definition from the scripting documentation. The issue is that there are the char 'U+200B' between the method name and the parentheses. And if se do copy/past and put this into velocity or other script the script could will fail because of this unknown char and it's difficult to debug as it's an invisible char so without any tools to detect this it's just impossible to know why velocity crash.
This following tools can be used to see the issue: [https://www.soscisurvey.de/tools/view-chars.php]
So let's see a concrete example. Let's take this following method (copied from the scripting doc):
{code:java} addAttachment(XWikiAttachment attachment) {code} If we put this in the [previous tools|[https://www.soscisurvey.de/tools/view-chars.php]] we have this: {code:java} addAttachmentU+200B(XWikiAttachment attachment){code} We can also see this on the HTML code: {code:java} <span class="memberNameLink"><a href="#addAttachment(com.xpn.xwiki.doc.XWikiAttachment)">addAttachment</a></span>(<a href="XWikiAttachment.html" title="class in com.xpn.xwiki.doc">XWikiAttachment</a> attachment) {code} And if we put this in the [previous tools|[https://www.soscisurvey.de/tools/view-chars.php]] we can also detect it: {code:java} <span class="memberNameLink"><a href="#addAttachment(com.xpn.xwiki.doc.XWikiAttachment)">addAttachment</a></span>U+200B(<a href="XWikiAttachment.html" title="class in com.xpn.xwiki.doc">XWikiAttachment</a> attachment) {code} This issue happen mainly for all method so it's a generic issues for all part of the scripting doc. |
|