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

(minor bug) parenthesis in text #72

Closed
Hendrik opened this issue Sep 11, 2010 · 7 comments
Closed

(minor bug) parenthesis in text #72

Hendrik opened this issue Sep 11, 2010 · 7 comments
Labels

Comments

@Hendrik
Copy link

Hendrik commented Sep 11, 2010

Using this

option(value='') -- (optional) Predefined services --

will result in a 'SyntaxError: Unexpected token )' error.

Escaping the ( ) also results in an error.

@caerphoto
Copy link

I've encountered this, too. For now I've worked around it by using [ ] instead of ( ) in my text

@weepy
Copy link

weepy commented Oct 4, 2010

Could you

  1. pull out the attributes pre lexing, using a simple state machine and counting the brackets.

  2. Revert to using colons instead of equals

  3. Treat the inner attribute part as Javascript which is evaluated in the appropriate context. The resultant object is then enumerated.

E.g.

option(value: myVal({a:1}) )

=> attributes = eval( "{" + "value: myVal({a:1})" +"}");
=> for(i in attributes) ....

@tj
Copy link
Contributor

tj commented Oct 4, 2010

that is what I did with haml I believe, but its a bit more complicated in jade. and this bug here has nothing to do with attributes, we just need a context, because technically right now below would keep trying to parse attributes

input(type: 'text')(checked)(id='foo')

@weepy
Copy link

weepy commented Oct 5, 2010

sorry - i don't quite understand. Are you saying that jade wants to support multiple sets of attributes ? (seems unnecessary if so ?)

@tj
Copy link
Contributor

tj commented Oct 5, 2010

it wont work because I only check for attrs once, but the lexer continues to chomp away at "(" as if it were an attribute token

@tj
Copy link
Contributor

tj commented Oct 30, 2010

wow, ok. haha I will fix this soon, I rarely use jade since im always working on.. jade, and other framework/libraries, haha so now that im actually building a few little apps, i realize how annoying this bug is

@tj
Copy link
Contributor

tj commented Dec 9, 2010

Added test showing #72 is ok. Closed by 372de2a

seems fine

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

No branches or pull requests

4 participants