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

insertValue 无法插入html文本 #716

Closed
ihewro opened this issue Aug 14, 2020 · 6 comments
Closed

insertValue 无法插入html文本 #716

ihewro opened this issue Aug 14, 2020 · 6 comments
Assignees
Milestone

Comments

@ihewro
Copy link

ihewro commented Aug 14, 2020

请先看《提问的智慧》,并尝试到黑客派搜寻资料解决问题。


编辑模式

  • wysiwyg 所见即所得模式
  • ir 即时渲染模式
  • sv 分屏编辑预览模式

描述问题

                        vditor.insertValue('<font color="red">dsds</font>',true);
                        vditor.insertValue('<span style="color:red">dsds</span>',false);
                        vditor.insertValue('<span style="color:red">dsds</span>',true);

插入html文本,编辑器中只有文字,html标签都过滤掉了

这个函数是不支持html文本的吗 求解答

@ihewro
Copy link
Author

ihewro commented Aug 14, 2020

#428

@ihewro
Copy link
Author

ihewro commented Feb 15, 2021

今天升级到3.8.1 版本后,发现此问题又出现了
3.7.7版本是正常的

@Vanessa219
Copy link
Owner

应该是 @88250 改了底层的解析规则造成的

@88250
Copy link
Collaborator

88250 commented Feb 15, 2021

@ihewro 目前 font 标签仅会提取其中的文本。如果需要单独插入 HTML 的话估计要新开特性提议后再考虑,感谢反馈。

@z-950
Copy link

z-950 commented Jul 12, 2021

插入html的hack。

editor.insertValue(`&lt;embed src="${url}" width="100%" height="750px"&gt;`);

@u19900101
Copy link

求问大佬,按照您的方式能成功插入,但是插入这个<img src="http://lpgogo.top/a4.jpg" alt="a4.jpg" style="zoom:50%;" />后,显示为灰色代码,必须按回车键才能渲染img标签,请问有什么解决办法吗?
image

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

No branches or pull requests

5 participants