This commit is contained in:
joyqi
2013-11-30 16:45:31 +08:00
parent 5dd094a8be
commit 8b5119dca4
2 changed files with 14 additions and 1 deletions
+4
View File
@@ -70,6 +70,7 @@ $(document).ready(function () {
// 自动跟随
converter.hooks.chain('postConversion', function (html) {
// clear special html tags
html = html.replace(/<\/?(\!doctype|html|head|body|link|title|input|select|button|textarea|style|noscript)[^>]*>/ig, function (all) {
return all.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
@@ -78,6 +79,9 @@ $(document).ready(function () {
.replace(/"/g, '&quot;');
});
// clear hard breaks
html = html.replace(/\s*((?:<br>\n)+)\s*(<\/?(?:p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend|article|section|nav|aside|hgroup|header|footer|figcaption|li|dd|dt)[^\w])/gm, '$2');
if (html.indexOf('<!--more-->') > 0) {
var parts = html.split(/\s*<\!\-\-more\-\->\s*/),
summary = parts.shift(),