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
+3 -3
View File
@@ -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));
}
/**