Przeglądaj źródła

[[用罕见汉字替换。解决黑体术语渲染失败的问题

visuddhinanda 2 lat temu
rodzic
commit
1706cfa3ee
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      app/Http/Api/MdRender.php

+ 2 - 0
app/Http/Api/MdRender.php

@@ -216,7 +216,9 @@ class MdRender{
         /**
          * markdown -> html
          */
+        $markdown = str_replace(['[[',']]'],['㐛','㐚'],$markdown);
         $html = Str::markdown($markdown);
+        $html = str_replace(['㐛','㐚'],['[[',']]'],$html);
 
         #替换术语
         $pattern = "/\[\[(.+?)\]\]/";