[ https://issues.apache.org/jira/browse/TEXT-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17000098#comment-17000098 ]
Gary D. Gregory commented on TEXT-174: -------------------------------------- [~furkilic] Thank you for the report. Please do not forget to include a unit test in your PR ;) Gary > ScriptStringLookup does not accept ":" > --------------------------------------- > > Key: TEXT-174 > URL: https://issues.apache.org/jira/browse/TEXT-174 > Project: Commons Text > Issue Type: Bug > Affects Versions: 1.8 > Reporter: Furkan KILIC > Priority: Minor > > The usage of ":" can be pretty usefull for inside a ScriptStringLookup > > For example ternary operations : > {code:java} > ${script:javascript:'${myKey:-}' == '' ? 'Not Present' : 'Present' } > {code} > Today it's not possible to do that because the lookup only expect one ":" > {code:java} > final String[] keys = key.split(SPLIT_STR); > final int keyLen = keys.length; > if (keyLen != 2) { > throw IllegalArgumentExceptions.format("Bad script key format [%s]; > expected format is DocumentPath:Key.", > key); > } > {code} > But we can limit the number of split to two: > {code:java} > final String[] keys = key.split(SPLIT_STR, 2); > {code} > > I will create the PR for that later on > > Thanks a lot > > Best regards -- This message was sent by Atlassian Jira (v8.3.4#803005)