Xu Pengcheng created JEXL-441:
---------------------------------
Summary: tokenization error if "\n" in template expression.
Key: JEXL-441
URL: https://issues.apache.org/jira/browse/JEXL-441
Project: Commons JEXL
Issue Type: Bug
Reporter: Xu Pengcheng
The following code throws an exception: JexlExample.main:19@1:9 tokenization
error in '"'
{code:java}
JexlBuilder jexlBuilder = new JexlBuilder();
JexlEngine jexl = jexlBuilder.create();
JexlContext context = new MapContext();
context.set("name", "Hello");
String code = "return `${name + \"\\n\" + name}`;";
JexlScript script = jexl.createScript(code);
Object result = script.execute(context);
System.out.println("Expression Result: " + result); {code}
but if I change to
{code:java}
String code = "return `${name + \"\\t\" + name}`;"; {code}
which works.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)