瀏覽代碼

fix: 继续修复报告中的图片显示问题

gwd 2 周之前
父節點
當前提交
075d4591ae
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      resources/views/exam-analysis/pdf-report.blade.php

+ 3 - 3
resources/views/exam-analysis/pdf-report.blade.php

@@ -322,7 +322,7 @@
                     <div style="margin-bottom:6px; padding:6px; background:#f0fdf4; border-left:3px solid #10b981; border-radius:4px;">
                         <div style="font-weight:600; font-size:12px; color:#111827; margin-bottom:3px;">正确答案</div>
                         <div class="math-content" style="font-size:12px; line-height:1.5; color:#374151;">
-                            {!! nl2br(e($correctAnswer)) !!}
+                            {!! is_string($correctAnswer) ? $correctAnswer : json_encode($correctAnswer, JSON_UNESCAPED_UNICODE) !!}
                         </div>
                     </div>
                 @endif
@@ -332,13 +332,13 @@
                     <div style="margin-top:6px; padding:6px; background:#eff6ff; border-left:3px solid #3b82f6; border-radius:4px;">
                         <div style="font-weight:600; font-size:12px; color:#111827; margin-bottom:4px;">解题思路</div>
                         <div class="math-content" style="font-size:12px; line-height:1.5; color:#374151;">
-                            {!! is_array($solution) ? json_encode($solution, JSON_UNESCAPED_UNICODE) : nl2br(e($solution)) !!}
+                            {!! is_array($solution) ? json_encode($solution, JSON_UNESCAPED_UNICODE) : $solution !!}
                         </div>
                     </div>
                 @elseif(!empty($analysis) && $analysis !== '暂无解题思路记录')
                     <div style="margin-top:6px; padding:6px; background:#eff6ff; border-left:3px solid #3b82f6; border-radius:4px;">
                         <div style="font-weight:600; font-size:12px; color:#111827; margin-bottom:4px;">解题思路</div>
-                        <div style="font-size:12px; line-height:1.5; color:#374151;">{!! nl2br(e($analysis)) !!}</div>
+                        <div class="math-content" style="font-size:12px; line-height:1.5; color:#374151;">{!! $analysis !!}</div>
                     </div>
                 @endif