CSS/SCSS Normailize Snippets in Atom not working


#1

Are there any workarounds to this?


#2

Have you tried using the literal quote characters rather than escape sequences?

For reference:

http://unicode.org/cldr/utility/character.jsp?a=201C
http://unicode.org/cldr/utility/character.jsp?a=201D
http://unicode.org/cldr/utility/character.jsp?a=2018
http://unicode.org/cldr/utility/character.jsp?a=2019


#3

I don’t feel comfortable messing with the normalize features. I’m just a beginner using what my teacher gave me for starting projects. (Normalize, Border-box, Clearfix).

How come Atom can’t handle backslashes in general? My snippets work fine on Sublime Text, that’s where we originally got them for, but I’m just in the process of switching to Atom.


#4

Have you already tried escaping the backslashes?

Could this be a limitation of CSON? Try converting snippets.cson to snippet.json, Atom can handle both formats.


#5

I figured it out.

Here’s the article for anyone having this issue as well.

The escape sequence for Atom snippets is a double backslash apparently, so adding 2 backslashes fixes the error, and adding 4 keeps 1 backslash in the normalize code.


#6

The reason you need four backslashes is because there’s two layers of escaping occurring. First, CSON reads the string and escapes the first set of backslashes. \\\\201C becomes \\201C. Then the resulting string gets parsed by Snippets, escaping it again: \\201C becomes \201C, which is what you wanted.