branaway / Japid

A Java-based statically-typed fast template engine that can be used in any Java code. It has special adapter for use with the Play! Framework.
113 stars 18 forks source link

Elvis operator does NOT escape correctly when using escaped expression notation!!! #63

Closed mkurz closed 10 years ago

mkurz commented 10 years ago

Japid version 0.9.35 using the latest playframework 1.3.x branch.

Japid documentation says:

Of course you can use the Elvis operator with the escaped expression notation: ~{}.

But then put following lines in a japid template:

@String param1 = "Hel<b>l</b>o";
@String param2 = "Good<b>b</b>ye";
~{param1 ?: param2} <!-- works -->
@param1 = null;
~{param1 ?: param2} <!-- does NOT work/escape!!! -->

In the last line, when the default string value (param2) is used (because the Java expression before the Elvis operator is false), the param2 string will not be escaped!

Could this be fixed? Thanks!

mkurz commented 10 years ago

Any updates on this one? This is quite a bad bug...

branaway commented 10 years ago

will fix it soon.

2013/11/12 mkurz notifications@github.com

Any updates on this one? This is quite a bad bug...

— Reply to this email directly or view it on GitHubhttps://github.com/branaway/Japid/issues/63#issuecomment-28222285 .

branaway commented 10 years ago

Sorry for the delay, but I have a problem with some experiment code in the branch. It takes longer to implement. In the meantime, can you try ~{a ?: escape(b)} to get the effect?

branaway commented 10 years ago

Please try 0.9.36 to get the fix

2013/11/12 Bing Ran bing.ran@gmail.com

will fix it soon.

2013/11/12 mkurz notifications@github.com

Any updates on this one? This is quite a bad bug...

— Reply to this email directly or view it on GitHubhttps://github.com/branaway/Japid/issues/63#issuecomment-28222285 .

mkurz commented 10 years ago

Fixed! Thanks a lot!