Replies: 1 comment
-
Answering my own question.. parseElement.add("path", (e: ParseEvent) => {
// ...
const path = pathFromSvg(e.attribs!.d.trim());
// ...
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've noticed that any white space after closing the path command is not allowed.
This works:
But this doesn't:
And the error message I get:
If it's a single path like the example above, I can just trim the string but I was using
@thi.ng/defmulti
to parse a big SVG file and encountered the error. My SVG is exported from Adobe Illustrator and the generated SVG code sometimes has a weird line breaks like below where the closing double quote has a preceding line break. I think when a\n
is removed internally, it still has empty characters afterz
:So my question is what would be a good way to handle such a case? or can a
Path
object handle such exceptions?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions