DEV: Ignore SVG sprite symbols missing ids

This commit is contained in:
Penar Musaraj 2019-03-18 22:07:19 -04:00
parent b6a7b851c7
commit dafba62931
2 changed files with 4 additions and 1 deletions

View File

@ -365,7 +365,7 @@ License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL
svg_file = Nokogiri::XML(File.open(fname))
svg_file.css('symbol').each do |sym|
icons << sym.attributes['id'].value
icons << sym.attributes['id'].value if sym.attributes['id'].present?
end
end
icons

View File

@ -3,4 +3,7 @@
<symbol id="my-custom-theme-icon" viewBox="0 0 496 512">
<path d="M248 8C111.03 8 0 119.03 0 256s111.03 248 248 248 248-111.03 248-248S384.97 8 248 8zm0 376c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm0-128c-53.02 0-96 42.98-96 96s42.98 96 96 96c-106.04 0-192-85.96-192-192S141.96 64 248 64c53.02 0 96 42.98 96 96s-42.98 96-96 96zm0-128c-17.67 0-32 14.33-32 32s14.33 32 32 32 32-14.33 32-32-14.33-32-32-32z"></path>
</symbol>
<symbol class="id-missing" viewBox="0 0 64 64">
<path d="M18.679,56.392c-0.441,0-0.885-0.097-1.298-0.295c-1.04-0.5-1.702-1.551-1.702-2.705V10.608 c0-1.155,0.663-2.207,1.704-2.706c1.04-0.5,2.276-0.356,3.176,0.368l26.641,21.429c0.708,0.57,1.121,1.431,1.12,2.34 c-0.001,0.91-0.414,1.77-1.124,2.338L20.556,55.733C20.013,56.168,19.349,56.392,18.679,56.392z M21.68,16.871v30.271 l18.849-15.11L21.68,16.871z"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 570 B

After

Width:  |  Height:  |  Size: 1001 B