直接写死路径试试

This commit is contained in:
2024-12-07 18:13:21 +08:00
parent 1e4cf03967
commit ed45e281ec

View File

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