标签:htm lin 过滤 com pos += r.js 方法 第一个
KindEditor 4.1.11:
kindeditor-all.js 文件
第772行:
var re = /(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"‘<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+=‘[^‘]*‘))*)(\/)?>(\s*)/g;
改为:
var re = /([ \f\n\r\t\v]*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"‘<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+=‘[^‘]*‘))*)(\/)?>([ \f\n\r\t\v]*)/g;
KindEditor 4.1.10:
kindeditor.js 文件
第754行:
var re = /(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"‘<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+=‘[^‘]*‘))*)(\/)?>(\s*)/g;
改为:
var re = /([ \f\n\r\t\v]*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"‘<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+=‘[^‘]*‘))*)(\/)?>([ \f\n\r\t\v]*)/g;
其实就是把第一个和最后一个 \s 替换成 [ \f\n\r\t\v]
来源:http://www.lingchenliang.com/post/97.html
标签:htm lin 过滤 com pos += r.js 方法 第一个
原文地址:http://www.cnblogs.com/fogwang/p/7680265.html