Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using html entities via content — Octal literal in strict mode #188

Closed
thisguychris opened this issue Nov 12, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@thisguychris
Copy link
Member

commented Nov 12, 2016

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 ..."

@thisguychris

This comment has been minimized.

Copy link
Member Author

commented Nov 12, 2016

I'd like to add use case for this. Basically, content inside &:after or &:before are very useful for adding bullets, arrows, icons or whatever pseudo styling for your list.

@mxstbr

This comment has been minimized.

Copy link
Member

commented Nov 12, 2016

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

content: '\\2192';

That's why we have a linter. 😉

@mxstbr mxstbr closed this Nov 12, 2016

@mxstbr mxstbr added the question label Nov 12, 2016

@thisguychris

This comment has been minimized.

Copy link
Member Author

commented Nov 12, 2016

@mxstbr may I know what rule where you using in your linter to see this error?

@geelen

This comment has been minimized.

Copy link
Member

commented 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.

@geelen geelen changed the title using html entities via content using html entities via content — Octal literal in strict mode Nov 12, 2016

@geelen

This comment has been minimized.

Copy link
Member

commented Nov 12, 2016

Changed the title to help people googling this error message in future.

@viiiprock

This comment has been minimized.

Copy link

commented Mar 4, 2017

hah, I spent hours for this, even I though it's must be JS problems

@thysultan

This comment has been minimized.

Copy link

commented Mar 4, 2017

String.raw could fix this, though runtime support is less that great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.