We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
早上看到了CSST就来试了试
刚刚按照作者思路看了一下,自己测试的时候发现如果 css 中的 content 是JSON编码数据,也就是带有反斜杠的,getComputedStyle 出来的数据中,反斜杠会被去掉。
content
getComputedStyle
测试api:http://szukx.sinaapp.com/api/testcsst.php?id=1&text=%E4%B8%AD%E5%9B%BD
测试代码:
csst('http://szukx.sinaapp.com/api/testcsst.php?id=1&text=%E4%B8%AD%E5%9B%BD', function(err, text) { console.log(text) });
控制台的结果:
u4e2du56fd
正常应该是
\u4e2d\u56fd
想问问作者有什么办法解决的吗? 总不能把u前面手动加个反斜杠把。
The text was updated successfully, but these errors were encountered:
完善文本解码,以便支持 Unicode #1
e0f7f7f
CSS 中的字符串也需要转义,不过是另一套转义规则 参考:http://stackoverflow.com/questions/10393462/placing-unicode-character-in-css-content-value
可以这样考虑:
#__csst1 { content: "\4e2d\56fd"; } #__csst2 { content: "\\u4e2d\\u56fd"; }
传输 base64 字符串也是一种方案。
感谢反馈。
Sorry, something went wrong.
统一为 base64 编码,以适配未知的浏览器解析策略 #1
c4e02c1
No branches or pull requests
刚刚按照作者思路看了一下,自己测试的时候发现如果 css 中的
content
是JSON编码数据,也就是带有反斜杠的,getComputedStyle
出来的数据中,反斜杠会被去掉。测试api:http://szukx.sinaapp.com/api/testcsst.php?id=1&text=%E4%B8%AD%E5%9B%BD
测试代码:
控制台的结果:
u4e2du56fd
正常应该是
\u4e2d\u56fd
想问问作者有什么办法解决的吗?
总不能把u前面手动加个反斜杠把。
The text was updated successfully, but these errors were encountered: