es6-string-html
es6-string-html copied to clipboard
Backslash escape not detected
I'm trying to use backtick inside of a template string, but it seems like the plug in is not correctly detecting the escaped backtick. Here's a sample of the code.
template: html`
<div
class="classname"
:style="background-image: url(\`${cardImage ??
imgPlaceholder}');background-size: cover; cursor: pointer;\`
>
<div class="classname">
<span class="classname" style=""
>{{ title }}</span
>
</div>
</div>
`,
Could this be a bug?
I also have this issue
Could something like this be done?
/*HTML*/`
code ..... \` `
`/*HTML*/;
\${ is also affected
example
const html = /* html */ `
<ul>
<li data-value="${ JSON.stringify(1 + 1) }"></li> <!-- 🙂 -->
<li data-value="\${ JSON.stringify(1 + 1) }"></li> <!-- 🙁 -->
<li data-value="$\{ JSON.stringify(1 + 1) }"></li> <!-- 🙂 -->
<li data-value="` + JSON.stringify(1 + 1) + `"></li> <!-- 🫤 -->
</ul>
`