多了一级

This commit is contained in:
2024-12-07 18:11:44 +08:00
parent aa6fd6db64
commit 1e4cf03967

View File

@@ -24,7 +24,7 @@ function MarkdownEntities($markdown) {
return str_replace(['<', '>'], ['\\lt', '\\gt'], $matches[0]);
}, $markdown);
// 对图片内容存储到本机并替换
$saveDir = __DIR__ . "/../../upload/markdown";
$saveDir = __DIR__ . "/../upload/markdown";
$markdown = preg_replace_callback('/!\[.*?\]\((.*?)\)/', function ($matches) use ($saveDir) {
$imageUrl = $matches[1];
$savedPath = downloadImage($imageUrl, $saveDir);