|
|
@@ -222,7 +222,12 @@
|
|
|
<div class="{{ $optionsClass }}">
|
|
|
@foreach($options as $optIndex => $opt)
|
|
|
@php
|
|
|
- $label = chr(65 + (int)$optIndex);
|
|
|
+ // 兼容两种格式:数字索引 (0,1,2,3) 或字母键 (A,B,C,D)
|
|
|
+ if (is_numeric($optIndex)) {
|
|
|
+ $label = chr(65 + (int)$optIndex);
|
|
|
+ } else {
|
|
|
+ $label = strtoupper($optIndex);
|
|
|
+ }
|
|
|
// 对LaTeX公式中的特殊字符进行HTML实体编码,防止被浏览器当作HTML标签处理
|
|
|
$encodedOpt = htmlspecialchars($opt, ENT_QUOTES | ENT_HTML5, 'UTF-8');
|
|
|
$renderedOpt = $mathProcessed ? $encodedOpt : \App\Services\MathFormulaProcessor::processFormulas($encodedOpt);
|