(htmlbars) should inherit from Handlebars
See original GitHub issueI am currently working on refining the handlebars-language to support literal-segments:
The Handlebars-tests are working fine with my changes, but HTMLBars detection testcase no fails… because highlight.js
detects Handlebars instead of HTMLBars.
Now, the file that should be detected as HTMLBars, might was well be a Handlebars file
<div class="entry">
{{!-- only output this author names if an author exists --}}
{{#if author}}
{{#playwright-wrapper playwright=author action=(mut author) as |playwright|}}
<h1>{{playwright.firstName}} {{playwright.lastName}}</h1>
{{/playwright-wrapper}}
{{/if}}
{{yield}}
</div>
In my oppinion, there is no need for an HTMLBars language, because the syntax is actually the same as Handlebars. It even uses the Handlebars parser to generate an AST. Couldn’t htmlbars just be an alias of Handlebars.
I think the only difference really lies in the list of built-ins. HTMLBars/Glimmer/Ember seems to have many more builtin-helpers. But it should be possible to somehow handle that.
There are parts of the html-bars definition that should be moved into the handlebars-definition anyway (like sub-expressions).
I am willing to put some work into that. I just wanted to ask for your opinions first.
Issue Analytics
- State:
- Created 4 years ago
- Comments:47 (44 by maintainers)
I can live with that, just means we save up the breaking stuff for
10.0
…We’ll see if Egor has any concerns but this is what I had in mind for CPP/Arduino:
https://github.com/highlightjs/highlight.js/pull/2185
Best of both worlds… and now Arduino is really more of a “subclass” of CPP. If we started doing this a lot we could add a little more tooling to make it easier.