Baidu editor filter div code solution

Sometimes it is necessary to add text containing html codes to the topic content, but after adding it, it is found that the editor has removed some label elements and changed all divs to p. How to do this?

The editor of AB Template Network tells you that this is actually a mechanism in the editor, such as ckeditor, ueditor, etc. can do these operations, pbootcms uses the ueditor Baidu editor, so we can modify it according to this.

Find the core->extend->ueditor->ueditor.all.js file, at about line 10830, change allowDivTransToP: true to: allowDivTransToP: false,

find core->extend->ueditor->ueditor.config.js File, about 560-565 lines, remove the comment in front of the commented out code, and directly change it to:

//默认过滤规则相关配置项目
,disabledTableInTable:false  //禁止表格嵌套
// 允许进入编辑器的 div 标签自动变成 p 标签
,allowDivTransToP:false

 

Guess you like

Origin blog.csdn.net/weixin_38612163/article/details/129691364