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

problem with certain tag attributes #268

Open
smithy545 opened this issue Oct 19, 2016 · 1 comment
Open

problem with certain tag attributes #268

smithy545 opened this issue Oct 19, 2016 · 1 comment

Comments

@smithy545
Copy link

smithy545 commented Oct 19, 2016

I've run across a problem where some of my tag attributes don't work properly. The error I get is

...
File "<string>", line 1
    pyjade.runtime.attrs(attrs=[('name', ("valuePurchased" value="0")])
SyntaxError: invalid syntax

Now the tag itself looks like this

input(type="range" name="valuePurchased" value="0")

Clearly there is something wrong with how the parser is parsing the attributes as it's including the entire value attribute within the name attribute's value (it also happens when I switched the order of the name and value attributes). Now I thought it could be another error somewhere else in my jade that's resulting in an error here, as I've had that before, so I deleted the whole template file so was just this one line and I still got the exact same error.

@DoYouLikeOrigami
Copy link

I have something like this:

If input is like input.form__input(type="tel" placeholder="+7 999 999-99-99" required)
Compilation fails with
jinja2.exceptions.TemplateSyntaxError: expected token ')', got 'required'

after moving required attr to the beginning, for example
input.form__input(type="tel" required placeholder="+7 999 999-99-99")
Compilation works

It's not okey when I have only one attr and it's a conflict one, for example data
li.tabs-section__content-item(data-number="1")
Compilation fails with
jinja2.exceptions.TemplateSyntaxError: expected token ')', got 'data'

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

2 participants