For reference, the only things that can't be represented in with String.raw
are:
- Backslash as last char
String.raw`\`
is a syntax error, it thinks you're escaping the closing`
.String.raw`\\`
will output\\
, not\
.
- Interpolation sigils anywhere
String.raw`${`
is another syntax error, it thinks you're trying to interpolate but you don't have the expression and closing}
.String.raw`\${`
andString.raw`$\{`
both contain a backslash in the output
- Backticks anywhere
–
String.raw```
is another syntax error, that's actually 2 tagged template literals with the second one missing its closing`
.
String.raw`\``
contains a backslash in the output.