提交 0a583945 编写于 作者: C campaign

by zhanyi

上级 cd0438c2
......@@ -10,7 +10,8 @@ var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) {
htmlstr = htmlstr.replace(reg, '');
if(!ignoreBlank){
htmlstr = htmlstr.replace(/\s*<\/?(\w+)\s*(?:[^>]*)>\s*/g, function(a,b){
if(dtd.$inlineWithA[b]||dtd.$empty[b]){
//br暂时单独处理
if(!/^br$/i.test(b) && (dtd.$inlineWithA[b]|| dtd.$empty[b])){
return a.replace(/[\t\r\n]+/,'');
}
return a.replace(/^\s+/,'').replace(/\s+$/,'');
......
......@@ -77,7 +77,7 @@ UE.plugins['insertcode'] = function() {
});
return lang;
}
}
};
me.addInputRule(function(root){
utils.each(root.getNodesByTagName('pre'),function(pre){
......@@ -225,7 +225,7 @@ UE.plugins['insertcode'] = function() {
return;
}
var html = node.type == 'element' ? node.innerText() : node.getData();
frag.appendChild(me.document.createTextNode(html.replace(/&nbsp;/g,' ')));
frag.appendChild(me.document.createTextNode(utils.html(html.replace(/&nbsp;/g,' '))));
br = me.document.createElement('br');
frag.appendChild(br);
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册