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

Better encoding, currentColor support and identifier escaping #27

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

zlondrej
Copy link

@zlondrej zlondrej commented May 17, 2021

This is batch of changes that was necessary for my SVG sprite tool.

  • currentColor support:
  • Identifier escaping
    • I wanted to use . character as part of identifier. This is perfectly valid in HTML/XML. As such, CSS supports such identifier as well, the special character just have to be escaped.
  • Unicode encoding
    • Default "encoding-less" ByteString approach doesn't work properly (loading and storing) when SVG contains some multi-byte characters. This specifically applies to CSS escaping for identifiers, which would escape the multi-byte characters as separate characters instead of single one when ByteString is used instead of String or Text.
  • Flag parsing in path's arc
    • Some SVG optimizers can produce output like this a1.3 1.3 0 01-1.3-1.3 (yes, it's valid). You can see 01 in the output which no a single number, but two flags. Current path parser failed on such path segment.

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

Successfully merging this pull request may close these issues.

1 participant