如何让eyou(百度编辑器)内容不自动加上p标签后缀

1.将 ueditor.all.js文件里的<p> <br/> </p> 所有标签全部删除

2.找到 ueditor.all.js文件里的

//给文本或者inline节点套p标签

  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 = '<div>' + (browser.ie ? ' ' : '<br/>') + '</div>' + 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;

      }

    }

  }

这一段,把里面的单独p文字全部删掉或者注释掉

3.ueditor.all.js文件里的 allowDivTransToP:true 把true改成false

4、注视掉这段

node.className = utils.trim(node.className.replace(/list-paddingleft-\w+/,'')) + ' list-paddingleft-' + type;

5、最后注视掉:

li.style.cssText && (li.style.cssText = '');

6.所有引用文件里的ueditor.all.min.js全改成ueditor.all.js

7.替换的文件路径为
/application/admin/template/article (文章模型)
/application/admin/template/images (图集模型)

转自:http://www.eyoucms.com/help/eyoujq/3645.html

转载于:https://blog.51cto.com/13839324/2338564

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值