- A+
所属分类:编程茶楼
如图:dedecms+ueditor 评论添加表情图片无法显示,审核元素是src中多了“/”
解决办法:
1.inc_fun_funAdmin.php中为修改:
$code .= '<script type="text/javascript" charset="utf-8" src="'.$GLOBALS['cfg_cmspath'].'/include/ueditor/ ueditor.all.js "></script>';
2.ueditor.all.js中大概8736行,按照注释取消掉/“”等
function isElement(node, arr, formatter, current) { var attrhtml = ''; if (node.attrs) { attrhtml = []; var attrs = node.attrs; for (var a in attrs) { //这里就针对 //<p>'<img src='http://nsclick.baidu.com/u.gif?&asdf=\"sdf&asdfasdfs;asdf'></p> //这里边的\"做转换,要不用innerHTML直接被截断了,属性src //有可能做的不够 /*attrhtml.push(a + (attrs[a] !== undefined ? '="' + (notTransAttrs[a] ? utils.html(attrs[a]).replace(/["]/g, function (a) { 2016-8-26*/ /*attrhtml.push(a + (attrs[a] !== undefined ? '=="' + (notTransAttrs[a] ? utils.html(attrs[a]).replace(/["]/g, function (a) {2016-8-26*/ attrhtml.push(a + (attrs[a] !== undefined ? '=' + (notTransAttrs[a] ? utils.html(attrs[a]).replace(/["]/g, function (a) { return '"'/*"*/ /*}) : utils.unhtml(attrs[a])) + '"' : '')) 2016-8-26*/ }) : utils.unhtml(attrs[a])) + '' : '')) } attrhtml = attrhtml.join(' '); } arr.push('<' + node.tagName + (attrhtml ? ' ' + attrhtml : '') + (dtd.$empty[node.tagName] ? '' : '' ) + '>' /*之前是\/*/ ); //插入新行 if (formatter && !dtd.$inlineWithA[node.tagName] && node.tagName != 'pre') { if(node.children && node.children.length){ current = insertLine(arr, current, true); insertIndent(arr, current) } } if (node.children && node.children.length) { for (var i = 0, ci; ci = node.children[i++];) { if (formatter && ci.type == 'element' && !dtd.$inlineWithA[ci.tagName] && i > 1) { insertLine(arr, current); insertIndent(arr, current) } nodeToHtml(ci, arr, formatter, current) } } if (!dtd.$empty[node.tagName]) { if (formatter && !dtd.$inlineWithA[node.tagName] && node.tagName != 'pre') { if(node.children && node.children.length){ current = insertLine(arr, current); insertIndent(arr, current) } } arr.push('<\/' + node.tagName + '>'); } }
3.评论引用下划线还有些问题,可以在ueditor.all.js中修改..有空再弄了..已经搞了一天了
- 我的微信
- 这是我的微信扫一扫
- 我的微信公众号
- 我的微信公众号扫一扫