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

Symbols for attribute values? #156

Open
rnikander opened this issue Feb 17, 2019 · 5 comments
Open

Symbols for attribute values? #156

rnikander opened this issue Feb 17, 2019 · 5 comments

Comments

@rnikander
Copy link

Would you be interested in a pull request that got this to work:

[:form {:method 'post} ...

Like the following already works:

[:div {:style {:box-sizing 'border-box ...
@rnikander
Copy link
Author

I just noticed that [:input {:type 'password ... also seems to work. So it appears be inconsistent. ?

@weavejester
Copy link
Owner

user=> (use 'hiccup2.core)
nil
user=> (str (html [:form {:method 'post}]))
"<form method=\"post\"></form>"

Can you provide an example where quoted symbols don't work?

@rnikander
Copy link
Author

It appears to be triggered by having a variable within the HTML data:

user=> (let [x "foo"] (hic/html [:form {:method 'post} x]))
"<form method=\"quote post\">foo</form>"

@weavejester
Copy link
Owner

Thanks, I can reproduce that on master. That is a bug, and I would be interested in a PR to fix it.

@rnikander
Copy link
Author

Okay, I don't have a PR at the moment. Looking at the code I can see sort of where the problem is (compile-attr-map, unevaluated?) but I don't understand it enough to fix it.

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