Thursday, 10 May 2018

Converting svg to base64

So i was trying to to convert some svg string to base64. Was using this nice module and them get an error. When looked into it I found out the core function to do that is URL.createObjectURL. And my bug was eventually solved by adding xmlns="http://www.w3.org/2000/svg" to my svg element. I have no idea why that happened...