question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handlebars support

See original GitHub issue

Hey, I’m using your library in the sublime extension and was beginning to think whether there exists the possibility to add some custom parser for Handlebars? Because there are some specialities to using Handlebars (and in some time HTMLBars).

One example would be:

{{em-input label="Some Labe" property="amt" type="text" placeholder=""}} {{em-input label="Type*" property="type" type="text" placeholder="(LTD)"}} {{em-input label="Place*" property="place" type="text" placeholder=""}} 

Should be formatted like this:

{{em-input label="Some Labe" property="amt" type="text" placeholder=""}}
{{em-input label="Type*" property="type" type="text" placeholder="(LTD)"}}
{{em-input label="Place*" property="place" type="text" placeholder=""}} 

but the html-parser doesn’t understand that syntax. That is understandable but I like that to change 😃

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:7
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sprucecommented, May 1, 2018

Some current Handlebars-issues: #576 #566 #577 #623 #1040 #1173 #1199

0reactions
bitwisemancommented, May 1, 2018

It’s a little hard to nail down because the html beautifier doesn’t parse the tags into tokens before formatting.

This is the main loop. There are some special treatment of some handlebars tags but most of them are treated like regular tags. Not great. https://github.com/beautify-web/js-beautify/blob/master/js/src/html/beautifier.js#L882

If you do a search for indent_handlebars you’ll find a bunch of other places with special cases for handlebars.

The best thing to do would be to get the html beautifier to parse all input separate from formatting, but that is a bigger effort.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handlebars
Mustache-compatible. Handlebars is largely compatible with Mustache templates. In most cases it is possible to swap out Mustache with Handlebars and continue ...
Read more >
Handlebars.js documentation - DevDocs
Handlebars.js 4.0.12 API documentation with instant search, offline support, keyboard shortcuts, mobile version, and more.
Read more >
A Beginner's Guide to Handlebars - SitePoint
Handlebars supports both normal and nested path, making it possible to look up properties nested below the current context.
Read more >
Handlebars Support - IntelliJ IDEs Plugin | Marketplace
Handlebars Support · Go to Declaration from mustache fields to fields in POJO class · Completion for POJO class fields inside Hbs mustaches...
Read more >
handlebars-lang/handlebars.js: Minimal templating on steroids.
If you need to support older environments, use Handlebars version 4. Performance. In a rough performance test, precompiled Handlebars.js templates (in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found