Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables in the template trueText nullText raise Template parsing error #37

Closed
phyng opened this issue May 5, 2023 · 1 comment
Closed

Comments

@phyng
Copy link

phyng commented May 5, 2023

If variables in the template start with true/false/null (<text>{{ trueText }}</text>), it will cause a syntax error.

Test:

https://npm.runkit.com/glass-easel-template-compiler

Code:

const glassEaselTemplateCompiler = require("glass-easel-template-compiler")
const g = new glassEaselTemplateCompiler.TmplGroup()
g.addTmpl('/path', '<text>{{ trueText }}</text>')
console.log(g.getTmplGenObjectGroups())

Return:

"Template parsing error (from line 1 column 14 to line 1 column 14) : Unexpected character"

It should be related to the syntax definition of this file:
https://github.com/wechat-miniprogram/glass-easel/blob/1874b8d2099ec62364113be76f3939b81a10a6e7/glass-easel-template-compiler/src/tmpl.pest

@LastLeaf
Copy link
Member

LastLeaf commented May 5, 2023

There is a bug when parsing template keywords with pest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants