Open Madoshakalaka opened 2 years ago
The parsing error is trigger not by the base 64, but by the semicolon after data:image/png;...
. This is incorrectly recognized as the end of the attribute, instead of scanning for the closing bracket. As a work-around, the following is correctly parsed, note the url is now a string token. Haven't fully tested this across browsers.
let class = css!(r#"
a[target="_blank"]::after{
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==");
margin: 0 3px 0 5px;
}
"#);
The new parser should be coming relatively soon and should have a way to deal with url(...)
a little bit better.
If there's a workaround that works at the moment, I think this issue can be solved with the new parser. (But if someone is interested in a PR, I will review it and publish a fix.)
I was following this tutorial and noticed something in base64 breaks the macro at compile time.
This passes:
This panics:
Producing code