question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

using html entities via content — Octal literal in strict mode

See original GitHub issue

Version

1.0.5

Reproduction

http://www.webpackbin.com/VyBp2UlWz

Steps to reproduce

add &:after { content: '\2192'; } inside any line element

Expected Behavior

should output html arrow / entity, etc. →

Actual Behavior

parse error “Octal literal in strict mode …”

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

31reactions
mxstbrcommented, Nov 12, 2016

Just need to escape the backslash. This works perfectly fine:

content: '\\2192';

That’s why we have a linter. 😉

2reactions
geelencommented, Nov 12, 2016

Ah what a pain! I don’t think there’s anything we can do about this, that’s just a fundamental difference from JS strings and CSS text. But it means you can’t quite “just copy-paste CSS!” which is what I was hoping for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Octal literals are not allowed in strict mode - Stack Overflow
Uncaught SyntaxError: Octal literals are not allowed in strict mode. I know codes in styles: [``] needs to be CSS codes. And I...
Read more >
SyntaxError: "0"-prefixed octal literals and octal escape seq ...
Octal literals and octal escape sequences are deprecated and will throw a SyntaxError in strict mode. The standardized syntax uses a leading ...
Read more >
Chapter 1, The JavaScript Not-So-Simple Building Blocks
You can quickly tell the difference between a primitive and an object instance when you compare an object instance to a literal value...
Read more >
Embedding numbers into strings in strict mode - SitePoint
Hi all, I am trying to assign a file path to a variable in Typescript while in strict mode. The path has numbers...
Read more >
All You Need to Know About JavaScript from ... - Morioh
In modern environments, with strict mode enabled, you will get an error. ... literals is an array containing the template literal content tokenized...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found