Handle escaping for templated snippets