Hacker News new | ask | show | jobs
by littlestymaar 673 days ago
With the first example you have syntax highlighting and compile-time check.

With the second of you have stringa.

2 comments

If you use a html`` tagged template literal combined with the html-in-template-string vs code extension you get syntax highlighting. A simple html identity literal function is a one-liner: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Why wouldn't one be able to tell syntax highlighters and code checkers that the string that goes into the html.something() functions is html?