增加一个图片文件转存的功能

This commit is contained in:
2024-12-07 18:07:29 +08:00
parent d7aa8ef257
commit aa6fd6db64
4 changed files with 41 additions and 21 deletions

View File

@@ -128,7 +128,10 @@ if ($pr_flag) {
strpos($s, "class=\"md") === false
) // 没找到,那就加上
$s = "<span class='md'>" . $s . "</span>";
// $s = html_entity_decode($str, ENT_QUOTES, 'UTF-8');
// 删除代码块里的<br />防止引起混乱
$s = preg_replace_callback('/(```.*?```|`[^`]*`)/s', function ($matches) {
return str_replace('<br />', '', $matches[0]);
}, $s);
// 特殊转义
$s = str_replace("<br />", "\n", $s);
return $s;