Parsing error

I came across with parsing error

Screen Shot 2020-03-10 at 19.13.27

Screen Shot 2020-03-10 at 19.13.32

Is it because of content property value?

Screen Shot 2020-03-10 at 19.15.19

The problem is the backslash. You need two backslashes to represent a backslash within an HTML or Markdown tagged template literal because a single backslash is reserved for Unicode escape sequences (e.g., \u00A9).

Try \\25B6 instead of \25B6.

Previously, this was a syntax error… and it still is if you use an untagged template literal. If you try this, you’ll see a SyntaxError: Bad escape sequence in untagged template literal.

`bad escape sequence: \unicode`

Possibly our tagged template literals should throw a SyntaxError in this case.

1 Like