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

s/css class names in node/express #174

Open
dyspop opened this issue Sep 7, 2016 · 2 comments
Open

s/css class names in node/express #174

dyspop opened this issue Sep 7, 2016 · 2 comments

Comments

@dyspop
Copy link

dyspop commented Sep 7, 2016

correct me if i'm missing something but i can't seem to work around the fact that this framework uses invalid class names (which browsers don't care about when loaded as css) and node won't have this.

index.pug:
.six.actions.vertical.signup-email.6u$.12u$(xsmall)

but at express app run


Error: /Users/danielblack/code/dan.black/views/index.pug:139:47

 > 139|             .six.actions.vertical.signup-email.6u$.12u$(xsmall)
-------------------------------------------------------^

Class names must begin with "-", "_" or a letter.
   at makeError (/Users/danielblack/code/dan.black/node_modules/pug-error/index.js:32:13)
   at Lexer.error (/Users/danielblack/code/dan.black/node_modules/pug-lexer/index.js:58:15)
   at Lexer.className (/Users/danielblack/code/dan.black/node_modules/pug-lexer/index.js:416:12)
   at Lexer.callLexerFunction (/Users/danielblack/code/dan.black/node_modules/pug-lexer/index.js:1315:23)
   at Lexer.advance (/Users/danielblack/code/dan.black/node_modules/pug-lexer/index.js:1351:15)
   at Lexer.callLexerFunction (/Users/danielblack/code/dan.black/node_modules/pug-lexer/index.js:1315:23)
   at Lexer.getTokens (/Users/danielblack/code/dan.black/node_modules/pug-lexer/index.js:1371:12)
   at lex (/Users/danielblack/code/dan.black/node_modules/pug-lexer/index.js:12:42)
   at Object.load.string.lex (/Users/danielblack/code/dan.black/node_modules/pug/lib/index.js:93:27)
   at Function.loadString [as string] (/Users/danielblack/code/dan.black/node_modules/pug-load/index.js:44:24)

the important bit being: Class names must begin with "-", "_" or a letter.

@ajlkn
Copy link
Owner

ajlkn commented Oct 23, 2016

Does it let you unicode escape class names (eg. .\36 u instead of 6u)?

@pogan
Copy link

pogan commented Jan 7, 2017

Had the same problem. The workaround is quite trivial.
Instead of having:
.6u(class='12u(narrower)')
Do
div(class='6u 12u(narrower)')

And pug does not let unicode escape classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants