当前位置:网站首页>Ueeditor automatically appends P tags to rich text.br tags always wrap.br tag solutions
Ueeditor automatically appends P tags to rich text.br tags always wrap.br tag solutions
2022-06-26 04:16:00 【Never bow】
to update ::
I found these problems unsolved
Reprint :http://www.bomiw.com/news/useknowledge-377.html
Here's the content
UEditor It is a very good text editor developed by Baidu , But in use , The default is to automatically append each time p label . But in many cases , I don't need this p label , This is very annoying . Is there any way to eliminate the automatic addition p What about the label ?
The method is as follows :
First : open ueditor.all.js( or ueditor.all.min.js).
1、 Change the search to false:allowDivTransToP: false
2、 Search and modify the following :
// Editor cannot be empty
if (domUtils.isEmptyNode(me.body)) {
me.body.innerHTML = '';
}3、 Search for “/ Give text or inline Node sleeve p label ”, And replace the following
// Give text or inline Node sleeve p label
if (me.options.enterTag == 'p') {
var child = this.body.firstChild, tmpNode;
if (!child || child.nodeType == 1 &&
(dtd.$cdata[child.tagName] || isCdataDiv(child) ||
domUtils.isCustomeNode(child)
)
&& child === this.body.lastChild) {
this.body.innerHTML = '' + this.body.innerHTML;
} else {
var p = me.document.createElement('div');
while (child) {
while (child && (child.nodeType == 3 || child.nodeType == 1 && dtd.p[child.tagName] && !dtd.$cdata[child.tagName])) {
tmpNode = child.nextSibling;
p.appendChild(child);
child = tmpNode;
}
if (p.firstChild) {
if (!child) {
me.body.appendChild(p);
break;
} else {
child.parentNode.insertBefore(p, child);
p = me.document.createElement('div');
}
}
child = child.nextSibling;
}
}
}4、 Search for “ Enter the editor's li Must set p label ”, This should also be noted out
5、 Look at this :
node.className = utils.trim(node.className.replace(/list-paddingleft-\w+/,'')) + ' list-paddingleft-' + type;6、 Finally look away :
li.style.cssText && (li.style.cssText = '');
Perfect solution , The above is the whole process , However, some browsing needs to empty the cache to work .
边栏推荐
- 【掘金运营套路揭露】真心被掘金的套路....
- Upload script file (one sentence back door) WAF bypass (PHP)
- 2022.6.23-----leetcode. thirty
- 钉钉开放平台-小程序开发实战(钉钉小程序服务器端)
- Database related knowledge
- 1.基础关
- [从零开始学习FPGA编程-45]:视野篇 - 集成电路助力数字化时代高质量发展-2-市场预测
- Ipvs0 network card of IPVS
- China air compressor manufacturing market demand analysis and investment prospect research report 2022-2028
- Detailed explanation of widget construction process of fluent
猜你喜欢
![[Qunhui] this suite requires you to start PgSQL adapter service](/img/fb/1aea7eb833afc1a24531b612a98400.jpg)
[Qunhui] this suite requires you to start PgSQL adapter service

How to use EEPROM in 51 Single Chip Microcomputer?

Clickhouse stand alone installation

How does virtual box virtual machine software accelerate the network speed in the virtual system?

六、项目实战---识别猫和狗

一幅脑图总结一下需求分析(工作上实际遇到的情况的补充)

【QT】资源文件导入

钉钉开放平台-小程序开发实战(钉钉小程序服务器端)

35岁程序员炒Luna 千万资产3天归零,网友:和赌博一样

The stc-isp burning program for 51 single chip microcomputer always shows that "the target single chip microcomputer is being detected..." the cold start board does not respond
随机推荐
How does virtual box virtual machine software accelerate the network speed in the virtual system?
Unity移动端游戏性能优化简谱之 以引擎模块为划分的CPU耗时调优
BSC 及HT 等链的NFT 创造及绑定图片教程
Dix critères de base importants pour les essais de débogage de logiciels
College C language final exam · multiple choice questions · summary notes of mistakes and difficulties
[QT] dialog box
ipvs之ipvs0网卡
List of provinces, cities and counties in China
Lua grammar explanation
C generic
I/o virtualization technology - vfio
R language and machine learning
35岁程序员炒Luna 千万资产3天归零,网友:和赌博一样
Report on the "fourteenth five year plan" and future development direction of global and Chinese indoor vertical farms from 2022 to 2028
线程同步之读写锁
使用Jsoup提取接口中的图片
Syntax error of go language generic in IDE
微软禁止俄用户下载安装Win10/11
力扣 515. 在每个树行中找最大值
捕获数据包(Wireshark)