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

svg_elt "path" get's rendered without attributes #41

Open
tcoopman opened this issue Jul 21, 2021 · 3 comments
Open

svg_elt "path" get's rendered without attributes #41

tcoopman opened this issue Jul 21, 2021 · 3 comments

Comments

@tcoopman
Copy link
Contributor

The following code:

svg_elt "svg" [
svg_elt  ~a:[ clip_rule "evenodd"; d "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"; fill_rule "evenodd" ] []
]

gets rendered as:

<svg><path></path></svg>

while I expected the path to look like: <path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd"></path>

@alainfrisch
Copy link
Contributor

How are clip_rule, d and fill_rule defined?

@tcoopman
Copy link
Contributor Author

let clip_rule = str_prop "clip-rule"
let fill_rule = str_prop "fill-rule"
let fill = str_prop "fill"
let viewBox = str_prop "viewBox"
let xmlns = str_prop "xmlns"
let d = str_prop "d"

@alainfrisch
Copy link
Contributor

I'm not very familiar with SVG, but I suspect these must be defined as attributes, not as DOM properties. Can you try with attr instead of str_prop?

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