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

Handlebars and CDATA within html script element does not parse since 2.2.0 #151

Open
Zielun opened this issue Jul 25, 2016 · 1 comment
Open

Comments

@Zielun
Copy link

Zielun commented Jul 25, 2016

Using handlebars templates I can no longer use hbs elements within script tag like:
<script> obj.doSomething({{{hbsVar}}}); </script>
and
CDATA within script
<script type="text/javascript"> <!--//--><![CDATA[//><!-- some js here... //--><!]]> </script>
since version 2.2.0.
I get parsing error on these parts.

The CDATA section is part of my old, Gemius code and I assume I could remove them not to have errors and should be fine but issue with {{{hbsVar}}} is harder to fix this way.
startDelim and endDelim are set to {[{ and }]}
I use Grunt plugin with config:
nggettext_extract: { custom: { options: { options: { startDelim: '{[{', endDelim: '}]}' }, extensions: { hbs: "html" } }, files: { "lang/template.pot": ['src/main/js/**/*.js', 'src/**/*.hbs'] } } }

Version 2.1.15 works fine, so I assume that Espree 3.0 which is used since 2.2.0 is causing a problem? Following changelogs I can see that Espree since 3.0 switched to Acorn...

But maybe I am missing something in regards of configuration or is it known thing?
Thanks for hints how that could be handled with the latest version.

@reza67asgari
Copy link

I have an issue when handlebars renders my template script. when handlebars renders, it returns me CDATA on the server, but in localhost everything goes well. I don't know why it returns CDATA

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