This commit is contained in:
joyqi
2017-10-27 00:43:08 +08:00
parent eeedef972a
commit da1e1b8d3b
2 changed files with 10 additions and 5 deletions
+7 -2
View File
@@ -75,10 +75,15 @@ $(document).ready(function () {
'pre' : 'pre|code'
});
converter.hook('beforeParseInline', function (html) {
return html.replace(/^\s*<!\-\-\s*more\s*\-\->\s*$/, function () {
return converter.makeHolder('<!--more-->');
});
});
// 自动跟随
converter.hook('makeHtml', function (html) {
// convert all comment
html = html.replace(/&lt;!--(.+?)--&gt;/g, '<!--$1-->');
html = html.replace('<p><!--more--></p>', '<!--more-->');
if (html.indexOf('<!--more-->') > 0) {
var parts = html.split(/\s*<\!\-\-more\-\->\s*/),