You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To further shrink SVG content, we can select string literal formats tailored to reduce the number of escape characters involved, for each individual string constant. E.g., '"' is preferable to "\"", and "'" is preferable to '\''.
For each string constant, compare how the constant would be quote-escaped in double- vs. single-quoted formatted literals.
Select the minimal length format for that particular string constant and emit to output.
The text was updated successfully, but these errors were encountered:
This is interesting, I'm assuming this mostly applies to attribute values. Overall, it looks like we don't need to encode quot/apos entities if they're used in the other kind of quote.
On MDN, we can see various SVGs use different kinds of quotes for attribute values.
Assuming there are no consequences of this, we could achieve this by updating the types of of attrStart and attrEnd to be string | ((value: string) => string) and use one based on what would be smaller. This also preserved backward compatibility.
To further shrink SVG content, we can select string literal formats tailored to reduce the number of escape characters involved, for each individual string constant. E.g.,
'"'
is preferable to"\""
, and"'"
is preferable to'\''
.The text was updated successfully, but these errors were encountered: