mirror of
https://github.com/typecho/typecho.git
synced 2025-03-25 04:19:45 +01:00
Merge branch 'master' of github.com:typecho/typecho
This commit is contained in:
commit
8191c8fcea
@ -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(/<!--(.+?)-->/g, '<!--$1-->');
|
||||
html = html.replace('<p><!--more--></p>', '<!--more-->');
|
||||
|
||||
if (html.indexOf('<!--more-->') > 0) {
|
||||
var parts = html.split(/\s*<\!\-\-more\-\->\s*/),
|
||||
|
@ -28,8 +28,8 @@ class Markdown
|
||||
});
|
||||
|
||||
$parser->hook('beforeParseInline', function ($html) use ($parser) {
|
||||
return preg_replace_callback("/<!\-\-(.+?)\-\->/s", function ($matches) use ($parser) {
|
||||
return $parser->makeHolder($matches[0]);
|
||||
return preg_replace_callback("/^\s*<!\-\-\s*more\s*\-\->\s*$/s", function ($matches) use ($parser) {
|
||||
return $parser->makeHolder('<!--more-->');
|
||||
}, $html);
|
||||
});
|
||||
|
||||
@ -43,7 +43,7 @@ class Markdown
|
||||
));
|
||||
}
|
||||
|
||||
return $parser->makeHtml($text);
|
||||
return str_replace('<p><!--more--></p>', '<!--more-->', $parser->makeHtml($text));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user