Przeglądaj źródła

markdown 处理图片链接

visuddhinanda 1 rok temu
rodzic
commit
c83023867c
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      app/Http/Api/MdRender.php

+ 3 - 1
app/Http/Api/MdRender.php

@@ -651,7 +651,9 @@ class MdRender{
                     }
                     }
                     unset($GLOBALS['note']);
                     unset($GLOBALS['note']);
                 }
                 }
-                $output = $markdownWithTpl . "\n\n" . implode("\n\n",$footnotes);
+                //处理图片链接
+                $output = str_replace('/attachments/',config('app.url')."/attachments/",$markdownWithTpl);
+                $output = $output . "\n\n" . implode("\n\n",$footnotes);
                 break;
                 break;
         }
         }
         return $output;
         return $output;