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

prevent escaping & into & in attribute. #38

Closed
hozumi opened this issue Feb 7, 2012 · 2 comments
Closed

prevent escaping & into & in attribute. #38

hozumi opened this issue Feb 7, 2012 · 2 comments

Comments

@hozumi
Copy link

hozumi commented Feb 7, 2012

Is there a way to emit ampersand without escaping?

(hiccup.core/html (page-helpers/link-to "/a?b=1&c=2"))
; => "<a href=\"/a?b=1&amp;c=2\"></a>"
@weavejester
Copy link
Owner

No, because then it wouldn't be valid HTML.

Your link will render as "/a?b=1&c=2" in your browser, but in HTML and XML you need to escape the ampersand, even if it's embedded in an attribute.

@hozumi
Copy link
Author

hozumi commented Feb 8, 2012

I see. Thank you for telling me my misunderstanding.

@hozumi hozumi closed this as completed Feb 8, 2012
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