I often work with Angular and Typescript, and I'm fond of putting my Angular templates directly into my Typescript files. The resulting code is essentially Javascript with HTML snippets in it, like this:
showModal() {
return modalService.open({
template: `
<div>
<h1 class="some-class"
ng-click="some-method">A heading</h1>
</div>
`,
controller: ...
});
}
I would love if web-mode
could detect the HTML section and apply HTML syntax highlighting and indentation rules. But unfortunately, web-mode
seems to treat everything inside the backticks as a simple string, so it doesn't work.
Back when I used to work with Coffeescript this sort of thing worked fine, but Coffeescript used a different delimiter for multiline strings (triple double-quotes I think).
Is there some way to configure web-mode
to do the right thing here?