Baidu's Ueditor editor for security reasons, HTML documents that users paste in HTML mode are automatically stripped of style and escaped. Although safe, but very inconvenient.
Make a change to remove this function.
First, open the Ueditor.all.js
Two, about 9300 lines to find the///plugin editor default filter conversion mechanism, the following
[JavaScript]View PlainCopy
- ' Allowdivtranstop ':true
The value is changed to False. When True, the div is automatically converted to p.
Three, about 9429 lines, there is a case ' Li ', this is to remove the style Li inside, the case commented out.
Four, about 14058 lines, the following first Utils.each function comment out, this is automatically to Li inside the content to add a p.
Five, about 14220 lines,
[JavaScript]View PlainCopy
- Node.classname = Utils.trim (Node.className.replace (/list-paddingleft-\w+/,")) + ' list-paddingleft-' + type;
Comment out, this is automatically add a built-in style to UL.
The following 14222 lines
[JavaScript]View PlainCopy
- Li.style.cssText && (Li.style.cssText = ");
Comment out, this is the Li style that automatically removes the pasted code
Six, about 9327 lines and 9471 rows near the
[JavaScript]View PlainCopy
- else if (node.tagname = = ' span ' && (!node.attrs | | utils.isemptyobject (NODE.ATTRS))) {
- Node.parentNode.removeChild (node, true)
- }
Remove, this is the code if there is a similar <span> text </span> This does not include the style of <span> elements will be deleted <span> only the text is preserved.
At this point, we pasted in the HTML format of the UL and Li will not be escaped.
PS: The above version is modified based on the 1.3.6 version. The new version location may have changed or the issue has been resolved.
Baidu Ueditor Editor's HTML mode auto-replace style workaround