Ueditor in the HTML code mode, when the input with <div style= "" >, <iframe> such HTML-tagged content, switch to the editor mode, you will find that the input is deleted, automatically filtered out. Two solutions available:
1, "White list Law", this is the online search for a lot of configuration black and white list, but all applicable to the old version; the new version of the file name has changed a lot, and cannot find the original file described in those methods. However, the principle of a set of procedures is always the same, through a few days of research, try a variety of methods, found that the latest version (1.4.3) also has a so-called "white list", through the configuration can be implemented to the default filter rules to make changes.
In profile ueditor.config.js, about 354 lines, there is a comment://default filter rule related configuration items, here a few lines is the basic switch. Below is an XSS filter, inserthtml and other operations related configuration items, here is the focus of operations, "XSS filtering whitelist" that is ueditor in the source mode, not filtered tags.
For example: We modify Allowdivtranstop to false, add div tag in whitlist{} Whitelist, then clear the browser cache, edit div tag in source mode, add style, switch to editor mode, it will take effect; return to source mode, The div tag still exists.
Similarly, when inserting the video, so that the <embed><iframe> tag is not filtered out, you can add the corresponding tags and attributes in the whitlist{}, respectively:
2, "simple Rough Method": in the file ueditor.all.js, there is a function ue.plugins[' defaultfilter '] = function () {...}, which is commented, the editor default filter conversion mechanism. You can add a return statement directly at the beginning of the function so that all filtering mechanisms do not take effect.
Similarly, do the same with Ueditor.all.min.js: (searchable defaultfilter positioning)
This way, all the filtering mechanisms that Ueditor bring are not valid, and you can use HTML tags freely in source mode.
Baidu Editor Ueditor source mode filter Div/style and other HTML tags