Hufe921 / canvas-editor

rich text editor by canvas/svg
https://hufe.club/canvas-editor-docs
MIT License
3.47k stars 506 forks source link

每当设置html数据之后,所有的文本自行携带0.65的透明度。 #704

Closed ZaiQi-zq closed 1 month ago

ZaiQi-zq commented 1 month ago

version

0.9.86

instance.command.executeSetHTML({ header: '', main: '<p style="font-family: 仿宋; text-align: center; font-size: 32px;">下午好</p>', footer: '' });

instance.command.getHTML().main 结果'<div style="text-align: center;"><span style="font-family: 宋体; text-align: center; **color: rgba(0, 0, 0, 0.65)**; font-size: 32px;">下午好</span></div>'

What is expected?

修正或找出问题

What is actually happening?

0.65的透明度去不掉

ZaiQi-zq commented 1 month ago

会自动添加0.65的透明度,很头疼

Hufe921 commented 1 month ago

因为你字体颜色设置的有透明度。另外不要使用html作为编辑器交换格式,应该使用标准的编辑器数据结构:https://hufe.club/canvas-editor-docs/guide/schema.html