Is there any Vs Code extension to syntax-highlight HTML inside JavaScript strings?
Specifically I am writing web components
const html = content => `
<div>
<table>
${content}
</table>
</div>
`;
class BaseTable extends HTMLElement {
constructor() {
super();
}
set content(value) {
const template = document.createElement('template');
template.innerHTML = style + html(value);
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(template.content.cloneNode(true));
}
}
I want string inside html constant variable to be highlighted
Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.
Launch VS Code Quick Open ( Ctrl+P ), paste the following command, and press enter. ErrorLens turbo-charges language diagnostic features by making diagnostics stand out more prominently, highlighting the entire line wherever a diagnostic is generated by the language and also prints the message inline.
If you use lit-html, There's a plugin in vs code called lit-plugin for syntax highlighting. Syntax is,
const markup = content => html`
<div>
<table>
${content}
</table>
</div>
`;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With