-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Normalize case of SVG elements and attributes in HTML, and preserve accessibility attributes #6593
Conversation
…ccessibility attributes
|
Benchmark ResultsKitchen Sink 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... React HackerNews ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
AtlasKit Editor 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
@@ -2322,8 +2322,16 @@ describe('html', function() { | |||
}); | |||
|
|||
it('should work with bundle names that have colons in them', async function() { | |||
// Windows paths cannot contain colons, so write the file here (in memory). | |||
await overlayFS.mkdirp(path.join(__dirname, 'integration/url-colon')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this fix the colon issue? I notice the benchmarks still fail due to a invalid path with colons and I notice it on other PRs as well. Is that just a bug we introduced somewhere and is now in V2 ? 😟
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should but it seems the test is still failing on windows. I will look into it
Fixes #4675. Fixes #5004.
HTML attributes and element names are case insensitive, including foreign content such as SVG. However, SVGO does not support this and expects case sensitive names. This normalizes element and attribute names within embedded SVG before running htmlnano so it works as expected.
In addition, this disables some SVGO options that remove accessibility attributes such as ARIA and
role
, as well as the<title>
and<desc>
elements. These should be preserved on SVG that is embedded within HTML.