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

建议{{display}}换成另外一种点位符 #70

Open
qidizi opened this issue Mar 14, 2014 · 3 comments
Open

建议{{display}}换成另外一种点位符 #70

qidizi opened this issue Mar 14, 2014 · 3 comments

Comments

@qidizi
Copy link

qidizi commented Mar 14, 2014

使用了这个本身就是handlebars的变量格式,如果放置到模板中会被解析掉,
或者说我还没有找到转义它给二次的模板解析使用的方法,反正这都是一个麻烦事,这个点位符反正都是一个强记的,不如直接使用另外一种点位符然后在实现自己替换一下.
我现在的解决方案是不清楚是否有一种更加方便的转义,我现在实现helper来达到

@lizzie
Copy link
Member

lizzie commented Mar 14, 2014

你用 helper 怎么实现的? 可否分享下.

其实这边 {{display}} 这种一般就是简单的展示一些文案. 需要搞得很复杂嘛~~

@popomore
Copy link
Member

{{{display}}}

@qidizi
Copy link
Author

qidizi commented Mar 14, 2014

你搞错了吧?那是不对<>符号进行转义,是不是说不对{{{display}}}进行解析

是这样,如果我有一个模板内容是<input xxxyy="请选择 {{display}} ",,这时,handlebars进行解析, {{display}} 就没有了,到了validator这边它看到的 只是 xxxyy="请选择 ",
所以需要考虑配合模板时怎么用,
我不知道是否有什么写法让handlebars不解析{{display}},否则模板中是不能出现{{display}}写法的,现在我的写法就是使用handlebars的helper返回 {{display}

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

3 participants