On Sep 16, 2007, at 2:11 PM, Vincent Massol wrote:
Hi Guido,
On Sep 16, 2007, at 11:49 AM, G.Schoepp wrote:
Hi,
while looking for Vincent's new wiki entry
http://www.xwiki.org/xwiki/bin/view/Code/ImportUsersFromLDAP
an error message appeared. When I checked it I saw that the Groovy
code
inside the {code} block isn't treated as text but as code.
So what is intended here: Should Groovy code inside a {code} block be
displayed as text or should it be executed as a Groovy script?
Well this looks like a bug :(
I thought I had fixed everything in the code macro but apparently
not. Could you please create a JIRA issue for this and I'll try to
fix it quickly for the 1.1.1 release?
Actually I think I have fixed it (just waiting for your jira issue
now ;)).
I don't think the groovy code was executed but rather that it caused
some parsing exception. I've discovered that I had:
// Escape the Groovy special characters '<%' and '%>'
so
that the Groovy Renderer
// doesn't execute.
result = StringUtils.replace(result, "<%",
"<%");
result = StringUtils.replace(result, "%>",
">%");
Instead of:
// Escape the Groovy special characters '<%' and '%>'
so
that the Groovy Renderer
// doesn't execute.
result = StringUtils.replace(result, "<%",
"<%");
result = StringUtils.replace(result, "%>",
"%>");
And I didn't have a unit test for the groovy case :( (I have it now).
Thanks
-Vincent