修复自定义字体不显示的问题

master
落雨楓 5 days ago
parent a75e7c4ede
commit d88517db7a

@ -14,7 +14,7 @@ class ExtraFontWidget {
$existsFonts = []; $existsFonts = [];
} }
$content = $text = $parser->recursiveTagParseFully($text, $frame); $content = $text = trim($parser->recursiveTagParseFully($text, $frame));
if (empty($params['name'])) { if (empty($params['name'])) {
return '<span class="error">' . wfMessage('isekai-font-error-invalid-params')->parse() . '</span>' . $content; return '<span class="error">' . wfMessage('isekai-font-error-invalid-params')->parse() . '</span>' . $content;
} }
@ -35,11 +35,8 @@ class ExtraFontWidget {
} }
$fontId = $existsFonts[$fontName]; $fontId = $existsFonts[$fontName];
return [ return Html::openElement('span', [
Html::rawElement('span', [ 'class' => 'isekai-extra-font font-' . $fontId,
'class' => 'isekai-extra-font font-' . $fontId, ]) . $content . Html::closeElement('span');
], $content),
"markerType" => 'nowiki'
];
} }
} }

Loading…
Cancel
Save