Pārlūkot izejas kodu

fix: 继续调试pdf

大侠咬超人 5 dienas atpakaļ
vecāks
revīzija
6861a485fb
1 mainītis faili ar 8 papildinājumiem un 0 dzēšanām
  1. 8 0
      app/Services/ExamPdfExportService.php

+ 8 - 0
app/Services/ExamPdfExportService.php

@@ -1247,8 +1247,16 @@ class ExamPdfExportService
      */
      */
     private function inlineExternalResources(string $html): string
     private function inlineExternalResources(string $html): string
     {
     {
+        // 【调试】记录HTML内容信息
+        Log::warning('ExamPdfExportService: inlineExternalResources', [
+            'html_length' => strlen($html),
+            'has_katex_cdn' => strpos($html, 'cdn.jsdelivr.net/npm/katex') !== false,
+            'html_head_preview' => substr($html, 0, 1000),
+        ]);
+
         // 检查是否包含KaTeX CDN链接
         // 检查是否包含KaTeX CDN链接
         if (strpos($html, 'cdn.jsdelivr.net/npm/katex') === false) {
         if (strpos($html, 'cdn.jsdelivr.net/npm/katex') === false) {
+            Log::warning('ExamPdfExportService: HTML中没有KaTeX CDN链接,跳过内联');
             return $html;
             return $html;
         }
         }