本站资源均来自互联网,仅供学习与参考,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
Copyright @ 2015-2020 织梦园 版权所有
Power by DedeCms
鲁ICP备15039853号-1
鲁公网安备 37132302000249号
模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
***近在使用ueditor编辑器的时候发现,它会把正常的“ 与 ”转义为 “ ”
检查转义的方法发现对于“ ”是没有做处理的,需要自己加上去
ueditor.all.js unhtml:function (str, reg) { return str ? str.replace(reg || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g, function (a, b) { if (b) { return a; } else { return { '<':'<', '&':'&', '"':'"', '>':'>', "'":''' }[a] } }) : ''; },html:function (str) { return str ? str.replace(/&((g|l|quo)t|amp|#39|nbsp);/g, function (m) { return { '<':'<', '&':'&', '"':'"', '>':'>', ''':"'", ' ':' ' }[m] }) : ''; },
修复方法:
***个方法 unhtml 把 amp|lt|quot|gt|#39|nbsp 替换为 amp|lt|quot|gt|#39|nbsp|ldquo|rdquo就可以了
第二个方法html
修改成
html:function (str) { return str ? str.replace(/&((g|l|quo)t|#39|nbsp|ldquo|rdquo|amp);/g, function (m) { return { '<':'<', '"':'"', '>':'>', ''':"'", ' ':' ', '“':'"', '”':'"', '&':'&' }[m] }) : ''; },备注
如果替换后无效,请检查你引用的是否是 ueditor.all.min.js