Git Product home page Git Product logo

Comments (4)

sumory avatar sumory commented on July 26, 2024
  • 找到原因了,jsp中tomcat会去解析el表达式,好死不死的el表达式有使用${},所以juicer的符号跟它相冲,被解析掉了。
  • 可不可以把juicer使用的符号做成可配置的?

from juicer.

PaulGuo avatar PaulGuo commented on July 26, 2024

是的,跟JSP的语法是冲突,今晚发布的最新版本 0.5.0-stable 已经支持自定义语法边界符了,同时 tpl 参数支持接收 #id 自动从 DOM 获取模板 (script/textarea 中的模板)。

juicer.set('tag::interpolateOpen', '&{');

这样就可以使用 &{name} 作为变量输出的语法了,更多详细的配置可参见文档 http://juicer.name/docs/docs_zh_cn.html

from juicer.

sumory avatar sumory commented on July 26, 2024
  • 我大体看了下你用的边界符,差点自己去修改代码了,还好你加了自定义的功能。
  • 其实继续用${}的话也是可以的,就是把$转义掉就行了。

from juicer.

PaulGuo avatar PaulGuo commented on July 26, 2024

:) 非常感谢反馈,有些一些朋友也遇到了跟你一样的问题,就在这个版本做了可配置的支持。

转义其实是一个很不错的方法,不过如你所言边界符做成可配置的应该对于一个模板引擎而言更合理和灵活些。

Enjoy Juicer.

from juicer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.