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

图片配置 image 中的 defaultSize 不生效 #154

Open
Ilymfa opened this issue Mar 5, 2025 · 1 comment
Open

图片配置 image 中的 defaultSize 不生效 #154

Ilymfa opened this issue Mar 5, 2025 · 1 comment

Comments

@Ilymfa
Copy link
Contributor

Ilymfa commented Mar 5, 2025

如下代码示例, 当content中的富文本字符串中有img标签时, img的宽度默认是350 , 而不会使用 defaultSize 的值
new AiEditor({ element: "#aiEditor", placeholder: "点击输入内容1...", contentRetention: true, content: 'AiEditor 是一个面向 AI 的下一代富文本编辑器。<img src="https://avatars.githubusercontent.com/u/26398475?s=16&v=4" alt="" />', image: { defaultSize: 600 }, })

查看源码发现字啊 imgExt.ts 文件 addNodeView 方法中imgWidth使用的是一个固定值

Image

@yangfuhai
Copy link
Contributor

来个 pr 呗

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

2 participants