代码块中的尖括号处理
This commit is contained in:
@@ -5,5 +5,11 @@ function MarkdownEntities($markdown) {
|
||||
$markdown = preg_replace_callback('/\$\$(.*?)\$\$/s', function ($matches) {
|
||||
return str_replace(['<', '>'], ['\\lt', '\\gt'], $matches[0]);
|
||||
}, $markdown);
|
||||
$markdown = preg_replace_callback('/```(.*?)```/s', function ($matches) {
|
||||
return str_replace(['<', '>'], ['<', '>'], $matches[0]);
|
||||
}, $markdown);
|
||||
$markdown = preg_replace_callback('/`(.*?)`/s', function ($matches) {
|
||||
return str_replace(['<', '>'], ['<', '>'], $matches[0]);
|
||||
}, $markdown);
|
||||
return $markdown;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user