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 won't compile #1661

Closed
thec0keman opened this issue Dec 16, 2018 · 5 comments
Closed

Handlebars won't compile #1661

thec0keman opened this issue Dec 16, 2018 · 5 comments

Comments

@thec0keman
Copy link

Hi, I've been using a build from the homepage that includes handlebars in a web browser. When I run any markup through it, HTML comes through just fine, but Handlebars is replaced with placeholders.

JS:

  get highlighted() {
    return Prism.highlight(this.code, Prism.languages.handlebars, 'handlebars');
  }

Handlebars:

{{my-form name=(mut model.name)}}
<button class="large {{foo}}">
  x
</button>

Output:

___HANDLEBARS0___
<button class="large ___HANDLEBARS1___">
  x
</button>

When I try this same code in the test tool it works just fine, so I'm at a loss as to what is different from my code.

Are there any ways of debugging this, or any possible differences between the downloaded build and the test tool?

Thanks!

@mAAdhaTTah
Copy link
Member

Make sure you have the latest version. This may have fixed the issue.

@thec0keman
Copy link
Author

The bundle does say it is running 1.15, but I was thinking of building manually and see if that is any different.

@thec0keman
Copy link
Author

Yeah I just tested it off of master and am seeing the same behavior.

@RunDevelopment
Copy link
Member

There is a difference between the test page and the download link you provided.
The test page uses the unminified Prism files and the download page uses the minified ones by default, so there could be a problem with the minification process but this is highly unlikely.
(I just tested the minified files using you download link and everything worked.)

Can you please verify that the after-tokenize hook is run. (You will find this function somewhere in you prism.js file.)

Are you using any plugins?

@thec0keman
Copy link
Author

I realize my mistake, thanks for helping me debug!

I had all of the pieces I mentioned above, but I forgot I also had a WIP ES6 import that was stomping on the after-tokenize hook.

Thanks again!

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