Change ${expr} expressions to {{expr}}
guiprav opened this issue · comments
Gui Prá commented
${expr}
expressions need to be escaped when used inside template literals, e.g.:
jr.createElement(`
<a
jr-href="https://gnu.org/\${path}"
jr-text-content.bind="GNU \${subject}"
></a>
`, {
subject: 'Philosophy',
path: 'philosophy/philosophy.html',
});
{{expr}}
expressions avoid problems (doesn't require escaping, so there's no risk forgetting to):
jr.createElement(`
<a
jr-href="https://gnu.org/{{path}}"
jr-text-content.bind="GNU {{subject}}"
></a>
`, {
subject: 'Philosophy',
path: 'philosophy/philosophy.html',
});