Browse Source

渲染脚注

visuddhinanda 1 year ago
parent
commit
ba05f835e0
1 changed files with 7 additions and 4 deletions
  1. 7 4
      app/Http/Resources/ArticleResource.php

+ 7 - 4
app/Http/Resources/ArticleResource.php

@@ -196,12 +196,15 @@ class ArticleResource extends JsonResource
             $mode = $request->get('mode','read');
             $format = $request->get('format','react');
 
-            $html = MdRender::render($this->content,
-                                     $channels,$query_id,$mode,
-                                     'translation','markdown',$format);
+            $htmlRender = new MdRender([
+                'mode' => $mode,
+                'format'=>$format,
+                'footnote' =>true,
+            ]);
+            //$html = MdRender::render($this->content,$channels,$query_id);
             //Log::debug('article render',['content'=>$this->content,'format'=>$format,'html'=>$html]);
 
-            $data["html"] = $html;
+            $data["html"] = $htmlRender->convert($this->content,$channels);
             if(empty($this->summary)){
                 $data["_summary"] = MdRender::render($this->content,
                                                     $channels,$query_id,$mode,