You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stylus automatically converts the variable inside the fill attribute in the inline SVG data from brand-gray2 to #e8e8e8 which is a great thing.
As Chrome published a new update, the # characters will no longer accepted in data URI body:
[Deprecation] Using unescaped '#' characters in a data URI body is deprecated and will be removed in M67, around May 2018. Please use '%23' instead. See https://www.chromestatus.com/features/5656049583390720 for more details.
As mentioned in the deprecation notice, if i change the attr value from fill='#e8e8e8' to fill='%23e8e8e8', warning goes away.
I want to show the svg in browser with .html file,it's right! And then I want to render svg into canvas element. I got all elements included by svg with js code var data = document.getElementById('box').parentNode.innerHTML.
Use the method: CanvasRenderingContext2D.drawImage(data, 0, 0) to render data into canvas element. Absolutely warning was triggered. according to your illustrate, I changed the # symbol into %23, my .html didn't work as I expected! everything is wrong.
So I thought about the other way. in my .html file, svg's code didn't change, butI processed data like this: var data = document.getElementById('box').parentNode.innerHTML.replace(/#/g,'%23'). Well, the warning goes away, however the picture in canvas element isn't my expected. So do you have any ideal to solve this problem?
This is a new warning raised by Chrome recently.
I have the following stylus content:
Stylus renders it as follows:
Stylus automatically converts the variable inside the
fill
attribute in the inline SVG data frombrand-gray2
to#e8e8e8
which is a great thing.As Chrome published a new update, the
#
characters will no longer accepted in data URI body:As mentioned in the deprecation notice, if i change the attr value from
fill='#e8e8e8'
tofill='%23e8e8e8'
, warning goes away.You can see the details of the deprecation notice here: https://www.chromestatus.com/features/5656049583390720
The text was updated successfully, but these errors were encountered: