Menu

#417 Broken html after substring

undecided
closed-works-for-me
nobody
None
5
2014-11-05
2014-10-27
Eyal Lior
No

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.

Discussion

  • Dániel Dékány

    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
  • Eyal Lior

    Eyal Lior - 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.\&#xd;\&#xa;\&#xd;\&#xa;Responsibilities\&#x3a;\&#xd;\&#xa;\&#x2a; Manage campaigns and customer budgets\&#xd;\&#xa;\&#x2a; Analyze and optimize

    The last part (\&#xd;\&#xa;\&#x2a;) 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
  • Dániel Dékány

    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
  • Dániel Dékány

    • status: open --> closed-works-for-me
     

Log in to post a comment.