hinesboy / mavonEditor

mavonEditor - A markdown editor based on Vue that supports a variety of personalized features
http://www.mavoneditor.com/
MIT License
6.4k stars 917 forks source link

[Question] Electron环境下无法渲染本地图片 #737

Closed ch1ny closed 2 years ago

ch1ny commented 2 years ago

依赖版本

ch1ny commented 2 years ago

补充

该项目为 electronBrowserWindow 配置了 webSecurity: false,因此并非由同源机制导致无法访问本地文件。 在 electron 的开发者工具中直接修改渲染的 <img /> 标签的 src 可以使图片展示出来: image

jiawulin001 commented 2 years ago

这个问题是因为XSS防御过滤掉了高危属性,在新版本发布前,你可以通过 :xssOptions="false"关闭XSS来解决这个问题。

<mavon-editor :xssOptions="false"></mavon-editor>

This issue is due to the XSS filtering out high-risk attributes. You can use :xssOptions="false" to turn off XSS until a new version is released to solve this issue.

ch1ny commented 2 years ago

非常感谢各位开发者,我的问题已经解决


Thanks very much to all the developers. My problem has been solved.