Broken html after substring
Generates text that depends on changing data (like dynamic HTML).
Brought to you by:
revusky
My input contains the following piece:
*
it's a newline and an asterisk, encoded. The output is:
<B ...
My template does this:
${job_description?substring(0,150)} ...
Somehow, the substring converts that input to broken html. The result is that my daily emaill newsletter becomes all bold right after that spot.
Sorry, I don't understand. Is it
job_description
that contains the asterisk? And also the<B
? What exactly is the value of that string?Last edit: Dániel Dékány 2014-10-27
job_description contains a long string, the first 200 characters look like this:
Ad Operations Manager at xxxxxxxx fast growing app discovery platform.\
\
\
\
Responsibilities\:\
\
\* Manage campaigns and customer budgets\
\
\* Analyze and optimize
The last part (\
\
\*) is around the 150 where the substring is cutting the string. If you paste it into http://www.url-encode-decode.com/ you see it's a newline and an asterisk.
The output of freemarker engine is <B which means everything following will show in bold font.
Ps - I had to add a backslash \ before each & so it won't decode here - originally there is no \ in the input
Last edit: Eyal Lior 2014-10-27
But where does that
<B
come from? FreeMarker won't magically add it for sure.Last edit: Dániel Dékány 2014-10-27