Skip to content

Commit 22f09ed

Browse files
content: Error message for unexpected CSS class in vlist inner span
1 parent 9827271 commit 22f09ed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/model/katex.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,17 @@ class _KatexParser {
247247
for (final innerSpan in vlist.nodes) {
248248
if (innerSpan case dom.Element(
249249
localName: 'span',
250-
className: '',
251250
nodes: [
252251
dom.Element(localName: 'span', className: 'pstrut') &&
253252
final pstrutSpan,
254253
...final otherSpans,
255254
],
256255
)) {
256+
if (innerSpan.className != '') {
257+
throw _KatexHtmlParseError('unexpected CSS class for '
258+
'vlist inner span: ${innerSpan.className}');
259+
}
260+
257261
var styles = _parseSpanInlineStyles(innerSpan)!;
258262
final topEm = styles.topEm ?? 0;
259263

0 commit comments

Comments
 (0)