直接写死路径试试
This commit is contained in:
@@ -24,7 +24,7 @@ function MarkdownEntities($markdown) {
|
|||||||
return str_replace(['<', '>'], ['\\lt', '\\gt'], $matches[0]);
|
return str_replace(['<', '>'], ['\\lt', '\\gt'], $matches[0]);
|
||||||
}, $markdown);
|
}, $markdown);
|
||||||
// 对图片内容存储到本机并替换
|
// 对图片内容存储到本机并替换
|
||||||
$saveDir = __DIR__ . "/../upload/markdown";
|
$saveDir = "/home/judge/src/web/upload/markdown";
|
||||||
$markdown = preg_replace_callback('/!\[.*?\]\((.*?)\)/', function ($matches) use ($saveDir) {
|
$markdown = preg_replace_callback('/!\[.*?\]\((.*?)\)/', function ($matches) use ($saveDir) {
|
||||||
$imageUrl = $matches[1];
|
$imageUrl = $matches[1];
|
||||||
$savedPath = downloadImage($imageUrl, $saveDir);
|
$savedPath = downloadImage($imageUrl, $saveDir);
|
||||||
|
|||||||
Reference in New Issue
Block a user