当前位置:网站首页>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 .
边栏推荐
- [Flink] Flink source code analysis - creation of jobgraph in batch mode
- [从零开始学习FPGA编程-45]:视野篇 - 集成电路助力数字化时代高质量发展-2-市场预测
- Open source! Vitae model brushes the world's first again: the new coco human posture estimation model achieves the highest accuracy of 81.1ap
- VHDL design
- 力扣 515. 在每个树行中找最大值
- 而是互联网开始有了新的进化,开始以一种全新的状态出现
- But the Internet began to have a new evolution and began to appear in a new state
- 钉钉开放平台-小程序开发实战(钉钉小程序服务器端)
- 外包干了四年,人直接废了。。。
- The open software of win10 system is too small. How to make it larger (effective through personal test)
猜你喜欢
捕获数据包(Wireshark)
[Qunhui] this suite requires you to start PgSQL adapter service
線程同步之讀寫鎖
win10 系统打开的软件太小,如何变大(亲测有效)
Construction of art NFT trading platform | NFT mall
Optimization - multi objective planning
解析JSON接口并批量插入到数据库中
1. foundation closing
Unity移动端游戏性能优化简谱之 以引擎模块为划分的CPU耗时调优
Redis cache data consistency solution analysis
随机推荐
2022.6.23-----leetcode. thirty
C generic
Parse JSON interface and insert it into the database in batch
How to solve the problem that iterative semi supervised training is difficult to implement in ASR training? RTC dev Meetup
Custom parameter QR code picture combined with background picture to generate new picture node environment
win10 系统打开的软件太小,如何变大(亲测有效)
Ten important basic principles of software debugging and testing
Yolov5 improvements: replace the backbone
Detailed explanation of widget construction process of fluent
Verrouillage de lecture et d'écriture pour la synchronisation des fils
Detr3d multi 2D picture 3D detection framework
Development trend and prospect forecast report of China's financial industry 2022-2028 Edition
WPF value conversion
SQL related knowledge - DQL
Dix critères de base importants pour les essais de débogage de logiciels
Construction of art NFT trading platform | NFT mall
Optimization - multi objective planning
Small record of neural network learning 71 - tensorflow2 deep learning with Google Lab
MySQL enable logbin in Qunhui docker
解析JSON接口并批量插入到数据库中