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

custom expression indicator #1257

Closed
osher opened this issue Sep 27, 2016 · 3 comments
Closed

custom expression indicator #1257

osher opened this issue Sep 27, 2016 · 3 comments

Comments

@osher
Copy link

osher commented Sep 27, 2016

Hi

The expression indicators are {{ - }} and {{{ - }}}.

mustache allows me to switch the indicators like so:

{{=<% %>=}}

now the tags are swapped
<% title %>

and I'm going to put them back
<%={{ }}=%>

Trying to do the same with handlebars did not work:

$ node
> var hb = require('handlebars');
undefined
> hb.compile('I didn\'t changed the {{ title }}')( { title: 'tags' } )
'I didn\'t changed the tags'
> hb.compile('{{=<% %>=}} I changed the  <% title %>')( { title: 'tags' } )
Error: Parse error on line 1:
{{=<% %>=}} I got a  <
--^
Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'EQUALS'
    at Object.parseError (C:\ws\nodejs\cwt-oapi-util\node_modules\handlebars\dist\cjs\handlebars\compiler\parser.js:267:19)
    at Object.parse (C:\ws\nodejs\cwt-oapi-util\node_mo.....

Any plans to support it?

I'm asking because I consider handlebars for code generator, and the myriad of { and } gets to be a pain...

@stevenvachon
Copy link

stevenvachon commented Sep 27, 2016

This is a very old topic, but the project maintainers may have a new take on it. It'd be interesting to change the indicators to ${ and } to be ES6-like.

@nknapp
Copy link
Collaborator

nknapp commented Sep 27, 2016

see #350 for details

@lawnsea
Copy link
Collaborator

lawnsea commented Nov 23, 2016

Thanks, @nknapp. Looks like the answer is "no". @osher, if you have ideas for working around the issues laid out in #350, please reopen this issue.

@lawnsea lawnsea closed this as completed Nov 23, 2016
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

4 participants