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

:viewBox property in svg not correctly parsed to hiccup. #59

Closed
MawiraIke opened this issue Dec 28, 2020 · 2 comments
Closed

:viewBox property in svg not correctly parsed to hiccup. #59

MawiraIke opened this issue Dec 28, 2020 · 2 comments

Comments

@MawiraIke
Copy link

Totally enjoying the simplicity of using this library. I am trying to convert a SVG html string to hiccup but I noticed that the :viewBox property in svg's is not correctly parsed. The output is :viewbox instead of :viewBox which is not correctly translated by the browser hence the resulting svg is not displayed correctly. I am using the parse-fragment function although I noticed the issue also occurs in parse. The rest of the string is parsed correctly as far as I can tell. This is not a big issue since clojure has clojure.walk/postwalk which can easily fix this on the resulting hiccup but I guess it would be better to be implemented in the library. If this issue is not worked on soon, can I look into it later when I get time and make a PR?

@cassc
Copy link

cassc commented Dec 31, 2020

In html, attribute names are case-insensitive, Jsoup, which this library depends on, also converts attribute names to lower case intentionally.

Edit: after checking Jsoup source code, I found it has the option to preserve case, e.g.,

Parser parser = Parser.htmlParser().settings(preserveCase);

@MawiraIke
Copy link
Author

Thanks for the reply. That must be wierd since the case sensitivity wasn't working for me. The svg was plotted but the viewBox was not obeyed. I will check my code.

Since this issue seems like its already known, I will close this Issue. Thanks again for the reply.

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