html2jade icon indicating copy to clipboard operation
html2jade copied to clipboard

Breaks inline SVG's viewBox

Open codysherman opened this issue 8 years ago • 2 comments

Posting this here, apologies if it's already been fixed but it's still live on http://html2jade.aaron-powell.com/ and http://html2jade.org/ at least.

SVGs are being completely broken by the conversion. The attribute capitalization is not being preserved, which will break their functionality. In my case, I just spent the last 4 hours figuring out that "viewBox" got switched to "viewbox". The SVG still appears, but all responsive design resizing is removed.

Here is an example SVG to test (GitHub doesn't allow attached SVGs for some weird reason): <svg xmlns='http://www.w3.org/2000/svg' version='1.1' x='0' y='0' viewBox='0 0 500 170' enable-background='new 0 0 500 170' xml:space='preserve'> <path d='M12 20.5H0V0h56.7c23.7 0 40.7 12.2 40.7 33.8 0 14.6-7.9 24-15.9 28.1v0.4c14.2 4.3 21.1 17.6 21.1 30.9 0 26.2-20.9 38.1-45.3 38.1H24.6c-8.7 0-12.6-3.7-12.6-12.6V20.5zM56.9 53.6c10.2 0 15.9-7.4 15.9-16.8s-5.5-16.3-16.3-16.3H36.2v33.1H56.9zM40.3 110.7h18.9c11.8 0 18.5-7.9 18.5-19 0-10.9-6.8-18.9-18.5-18.9H36.2v33.8C36.2 109.2 37.7 110.7 40.3 110.7zM162 34.7c27 0 41.8 19.8 41.8 44.7 0 2.8-0.6 8.7-0.6 8.7h-65.1c1.8 16.6 14 25.3 28.3 25.3 15.2 0 26.4-10.5 26.4-10.5l9.8 16.3c0 0-14.4 14.2-37.9 14.2 -31.2 0-50.6-22.5-50.6-49.3C114.2 55.1 133.8 34.7 162 34.7zM179.8 71.9c-0.4-11.3-8.1-19-17.7-19 -12 0-20.5 7.2-23.1 19H179.8zM257.5 34.7c21.8 0 29 13.3 29 13.3h0.4c0 0 0-1.1 0-2.4 0-4.3 3-8.7 10.3-8.7h21.8v20h-7.2c-2.4 0-4.1 1.3-4.1 3.7v64.9c0 32.3-25.1 44.5-49.7 44.5 -11.8 0-24.4-3.3-33.5-8.1l7.2-18.5c0 0 11.6 6.3 26.1 6.3 14.2 0 26.6-6.1 26.6-23.1v-4.4c0-2.2 0.2-5 0.2-5h-0.4c-5.5 7.9-13.7 12.2-26.2 12.2 -27 0-42.3-21.8-42.3-47.7S230.4 34.7 257.5 34.7zM285.1 81.9c0-21.4-10.7-27.2-23.5-27.2 -14.2 0-22 10.3-22 26.2 0 16.4 8.3 28.6 23.5 28.6C274.4 109.6 285.1 103.1 285.1 81.9zM348.3 61c0-2.8-1.5-4.1-4.1-4.1h-7.4V37h22.4c8.7 0 12.4 3.9 12.4 12.6v57.8c0 2.6 1.5 4.1 4.1 4.1h7.4v19.8h-22.4c-8.7 0-12.4-3.7-12.4-12.6V61zM349.4 0h20.3v21.6h-20.3V0zM399.8 61c0-2.8-1.5-4.1-4.1-4.1h-7.4V37H410c8.3 0 12.4 3.9 12.4 10.5v2.8c0 2-0.4 4.1-0.4 4.1h0.4c4.1-7.9 14.2-19.6 33.3-19.6 20.9 0 32.9 10.9 32.9 35.9v36.8c0 2.6 1.5 4.1 4.1 4.1h7.4v19.8h-22.4c-8.9 0-12.6-3.7-12.6-12.6V75.4c0-11.5-3-19.2-14.8-19.2 -12.6 0-22 7.9-25.3 19.2 -1.3 3.9-1.8 8.1-1.8 12.6v43.2h-23.3V61z'/> <path d='M319.3 113.3h17.2v17.8h-17.2V113.3z'/> </svg>

It's very important to the ability to style/scale the inline SVG that the "B" in viewBox remains capitalized.

codysherman avatar Nov 20 '17 03:11 codysherman

Hello @codysherman -Thank you for bringing this up. I will take a look and come back to you about it.

aichholzer avatar Nov 22 '17 00:11 aichholzer

yes, this is indeed very important. It took me about 5 hours to realize the case sensitivity :)

basaran avatar Nov 27 '20 15:11 basaran