diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index 39ce0abdb..6b0f1621b 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -3311,6 +3311,7 @@ _each(('formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull if (!_IERANGE || _inArray(name, 'formatblock,selectall,insertorderedlist,insertunorderedlist'.split(',')) >= 0) { self.selection(); } + return self; }; }); @@ -5752,7 +5753,7 @@ _plugin('core', function(K) { h2 : 24, h3 : 18, H4 : 14, - p : 12 + p : 12 }, curVal = self.cmd.val('formatblock'), menu = self.createMenu({ @@ -5770,6 +5771,14 @@ _plugin('core', function(K) { checked : (curVal === key || curVal === val), click : function() { self.select().exec('formatblock', '<' + key + '>').hideMenu(); + //by yk利用html的特性使h1 h2 h3 h4标签之间不能相互包含 并将空的标签去掉 + if (key != "p"){ + var val = self.select().html(); + self.select().html(val); + val = self.select().html().replace(/(

\s*<\/h1>)|(

\s*<\/h2>)|(

\s*<\/h3>)|(

\s*<\/h4>)/g,""); + self.select().html(val); + self.select(); + } } }); }); diff --git a/public/assets/kindeditor/plugins/code/previewcode.css b/public/assets/kindeditor/plugins/code/previewcode.css index 352c77625..459fbd5d6 100644 --- a/public/assets/kindeditor/plugins/code/previewcode.css +++ b/public/assets/kindeditor/plugins/code/previewcode.css @@ -53,4 +53,4 @@ span.at a{color:#269ac9;text-decoration: none;} /*yk*/ .ke-content ol li{list-style-type: decimal;} .ke-content ul li{list-style-type: disc;} -.ke-content ol,.ke-content ul{margin-top:0;margin-bottom: 0;} \ No newline at end of file +.ke-content ol,.ke-content ul,.ke-content h1,.ke-content h2,.ke-content h3,.ke-content h4{margin-top:0;margin-bottom: 0;} \ No newline at end of file