-
Notifications
You must be signed in to change notification settings - Fork 24
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
Inline SVG attributes get lowercased #107
Comments
As you note, HTML is case insensitive (unlike XML), so it is expected that SVG inside of (AMP) HTML would get lower-cased. In fact, if I try running an SVG with a Source I used (notice <!DOCTYPE html>
<html lang=en>
<head>
<title>SVG in HTML</title>
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 137.7 25.1"><!--...--></svg>
</body>
</html> Therefore, I believe this is invalid. Relates to ampproject/amp-wp#2045. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
the optimizer does not seem to respect the XML Namespace. As SVG is XML, and thus case sensitive (opposed to HTML, which is case insensitive), the SVG viewBox attribute gets lowercased by the amp-optimizer. Browsers seem to ignore the problem, so this is more a nitpick.
See the
viewBox
attribute here:Before:
After optimization:
The w3c validator complains about the lowercased
viewbox
attribute when validated as SVG 1.1:The text was updated successfully, but these errors were encountered: