mirror of
https://github.com/svg/svgo.git
synced 2025-09-18 19:14:33 +03:00
- avoid using usage data when document contains <script> or on* attributes - implemented usage.force option to force usage data using
29 lines
760 B
XML
29 lines
760 B
XML
<svg xmlns="http://www.w3.org/2000/svg">
|
|
<style>
|
|
.used { p: 1 }
|
|
.unused { p: 2 }
|
|
</style>
|
|
<script>
|
|
/* with usage.force=true script element does not prevent removing unused styles */
|
|
</script>
|
|
<g class="used" onclick="/* with usage.force=true on* attributes doesn't prevent removing unused styles */">
|
|
test
|
|
</g>
|
|
</svg>
|
|
|
|
@@@
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg">
|
|
<style>
|
|
.used{p:1}
|
|
</style>
|
|
<script>
|
|
/* with usage.force=true script element does not prevent removing unused styles */
|
|
</script>
|
|
<g class="used" onclick="/* with usage.force=true on* attributes doesn't prevent removing unused styles */">
|
|
test
|
|
</g>
|
|
</svg>
|
|
|
|
@@@
|
|
{ "usage": { "force": true } } |