* Do not add hard linebreak for html template * Collapse whitespaces to single space char * restore line breaking * use `line` and rename vars * add test * support htmlWhitespaceSensitivity * indent if breakable * add htmlWhitespaceSensitivity test * indent only when multiple top levels * add a changelog entry * update snapshot * replace match with test * split tests into multiple files for better readability of snapshots * fix an edge case with html-in-js-in-html Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
33 lines
575 B
JavaScript
33 lines
575 B
JavaScript
const nestedFun = /* HTML */ `${outerExpr(1)}
|
|
<script>
|
|
const tpl = html\`<div>\${innerExpr(1)} ${outerExpr(2)}</div>\`;
|
|
</script>`;
|
|
|
|
const nestedFun2 = /* HTML */ `${outerExpr(1)}
|
|
<script>
|
|
const tpl = html\`\\n<div>\${innerExpr(1)} ${outerExpr(2)}</div>\\n\`;
|
|
</script>`;
|
|
|
|
setFoo(
|
|
html`<div>one</div>
|
|
<div>two</div>
|
|
<div>three</div>`,
|
|
secondArgument
|
|
);
|
|
|
|
setFoo(
|
|
html`<div>
|
|
<div>nested</div>
|
|
</div>
|
|
<div>two</div>
|
|
<div>three</div>`,
|
|
secondArgument
|
|
);
|
|
|
|
setFoo(
|
|
html`<div>
|
|
<div>nested</div>
|
|
</div>`,
|
|
secondArgument
|
|
);
|