Skip to content
New issue

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

微信小程序ios端svg展示不正常 #593

Open
Xuzhangzheng opened this issue Apr 23, 2024 · 4 comments
Open

微信小程序ios端svg展示不正常 #593

Xuzhangzheng opened this issue Apr 23, 2024 · 4 comments

Comments

@Xuzhangzheng
Copy link

续这个issue:#591
我们这边在替换了您的修改后,安卓设备展示正常,但是发现在ios手机上第三个svg无法展示文字,呈现效果如下
image

@Xuzhangzheng
Copy link
Author

svg3 (1).txt

@Xuzhangzheng
Copy link
Author

目前我们自己定位还是与foreignObject有关,用了这个就不展示里面的文字

@Xuzhangzheng
Copy link
Author

目前用的笨方法做了处理,方案是判断ios环境下处理foreignObject 转换成text和tspan结构才能正常在ios端显示,但这种治标不治本个人感觉,所以还是希望大佬看看是否可以解决这个问题,感谢

@Xuzhangzheng
Copy link
Author

Xuzhangzheng commented Apr 30, 2024

记录:
处理svg内容中有个traversal方法,方法体第一行判断node.type=='text'时直接拼接node.text的逻辑,在遇到符号“<”会出现无法正常展示的问题
示例图
image
目前使用的该方法进行了处理:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant