Using special characters within template with Handlebars


I’m trying to use an apostrophe in a text within a component of template in HBS, like this:

{t ‘If you can’t find the confirmation email, it might be stuck in your spam folder.’ }}

I also tried the HTML code for apostrophe:

If you can't

but it doesn’t work…how can I get it not to consider ’ as part of the code?

I think these 2 options should work:

  1. Double quotes {{t "Can't"}}
  2. Escape character {{t 'Can\'t'}}
1 Like

Both solutions work, thanks a lot, it was quite an annoying problem.

1 Like