3 ms·
With the first example you have syntax highlighting and compile-time check. With the second of you have stringa.
by littlestymaar 2y ago
With the first example you have syntax highlighting and compile-time check.
With the second of you have stringa.
- mg 2y agoWhy wouldn't one be able to tell syntax highlighters and code checkers that the string that goes into the html.something() functions is html?
- Joeri 2y agoIf 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/Reference/Global_Objects/String/raw#building_an_identity_tag https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...