3

I'm working on my first Meteor app, and I'm trying to escape a string on the server side. I was hoping to use Handlebars.Utils.escapeExpression, but even when I add handlebars (which I had to do, even though Meteor already uses it?), I still get

ReferenceError: Handlebars is not defined

error when that code is hit. Is there a way to invoke that method server side without manually including the source in my project?

Chris
  • 866
  • 9
  • 19

1 Answers1

1

Meteor uses Handlebars on the client only. Server-side rendering is on the roadmap.

Also, the Handlebars that comes with Meteor doesn't include Utils.

Use {{{thingThatNeedsEscaping}}} instead, as per the documentation that unescapes it.

Also, I don't think it's necessary to escape stuff before inserting it into the database, if you want it though there are other JS functions for that (like escape variants that are not deprecated).

Community
  • 1
  • 1
Tamara Wijsman
  • 12,198
  • 8
  • 53
  • 82