1:kindeditor-all.js 文件
var re = /(s*)<(/)?([w-:]+)((?:s+|(?:s+[w-:]+)|(?:s+[w-:]+=[^s"'<>]+)|(?:s+[w-:"]+="[^"]*")|(?:s+[w-:"]+='[^']*'))*)(/)?>(s*)/g;
修改爲如下(xià)行
var re = /([fnrtv]*)<(/)?([w-:]+)((?:s+|(?:s+[w-:]+)|(?:s+[w-:]+=[^s"'<>]+)|(?:s+[w-:"]+="[^"]*")|(?:s+[w-:"]+='[^']*'))*)(/)?>([fnrtv]*)/g;
可以用快速搜索/(s*)查找查找如下(xià)行
/(s*)<(/)?([w-:]+)((?:s+|(?:s+[w-:]+)|(?:s+[w-:]+=[^s"'<>]+)|(?:s+[w-:"]+="[^"]*")|(?:s+[w-:"]+='[^']*'))*)(/)?>(s*)/g
修改爲如下(xià)行:
/([fnrtv]*)<(/)?([w-:]+)((?:s+|(?:s+[w-:]+)|(?:s+[w-:]+=[^s"'<>]+)|(?:s+[w-:"]+="[^"]*")|(?:s+[w-:"]+='[^']*'))*)(/)?>([ fnrtv]*)/g
KindEditor 4.1.10版本(需要修改1個文件):
kindeditor.js 文件
var re = /(s*)<(/)?([w-:]+)((?:s+|(?:s+[w-:]+)|(?:s+[w-:]+=[^s"'<>]+)|(?:s+[w-:"]+="[^"]*")|(?:s+[w-:"]+='[^']*'))*)(/)?>(s*)/g;
改爲:
var re = /([ fnrtv]*)<(/)?([w-:]+)((?:s+|(?:s+[w-:]+)|(?:s+[w-:]+=[^s"'<>]+)|(?:s+[w-:"]+="[^"]*")|(?:s+[w-:"]+='[^']*'))*)(/)?>([ fnrtv]*)/g;
提示其實就是修改正則表達式将第一(yī)個和最後一(yī)個 s 替換成 [ fnrtv]就可以了!