Freemarker string escaping doesn't work with default operator -


We use Freemarker 2.3.20 and come in a strange behavior when using the default operator to escape this way With string:

  $ {picture. Author [0]! ""? Js_string}  

In this case, quotes are not saved in the value of the authors! " "is present.

We need to check the first value and the default session can not be used:

  & lt; #if pic. Author @ [0]? ? & Gt; {. Picture @ author [0] js_string?} $ & Lt; / # If & gt;  

It is quite ugly and has blown the code.

Is this a bug or a feature?

This operator is due to priority $ {picture. Author [0]! ""? Js_string} means $ {picture}. Author [0]! (""? Jsistring)} What do you want $ {(author. @ Author [0]! "")? Js_string} .


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -