handlebars-lang / handlebars.js

Minimal templating on steroids.
http://handlebarsjs.com
MIT License
17.96k stars 2.04k forks source link

how to insert `{{xxx}}}` #2012

Closed wszgrcy closed 11 months ago

wszgrcy commented 11 months ago

Before filing issues, please check the following points first:

This will probably help you to get a solution faster. For bugs, it would be great to have a PR with a failing test-case. https://jsfiddle.net/4qvo810e/ I want to insert {{xxx}}} and run with {xxx:1},expect result 1}, but throw error

handlebars.js:2992 Uncaught Error: Parse error on line 1:
{{xxx}}}
------^
Expecting 'CLOSE', 'OPEN_SEXPR', 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'CLOSE_UNESCAPED'
    at Parser.parseError (handlebars.js:2992:20)
    at Parser.parse (handlebars.js:3061:31)
    at parseWithoutProcessing (handlebars.js:2710:34)
    at HandlebarsEnvironment.parse (handlebars.js:2716:14)
    at compileInput (handlebars.js:4573:20)
    at ret (handlebars.js:4582:19)
    at ?editor_console=true:119:47

I try to add ` to solve it .It work,butspace` will effect template.