Skip to content

Commit 0bc5ab3

Browse files
content: Error message for unexpected CSS class in vlist inner span
1 parent 5fe01af commit 0bc5ab3

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
@@ -246,13 +246,17 @@ class _KatexParser {
246246
for (final innerSpan in vlist.nodes) {
247247
if (innerSpan case dom.Element(
248248
localName: 'span',
249-
className: '',
250249
nodes: [
251250
dom.Element(localName: 'span', className: 'pstrut') &&
252251
final pstrutSpan,
253252
...final otherSpans,
254253
],
255254
)) {
255+
if (innerSpan.className != '') {
256+
throw _KatexHtmlParseError('unexpected CSS class for '
257+
'vlist inner span: ${innerSpan.className}');
258+
}
259+
256260
var styles = _parseSpanInlineStyles(innerSpan);
257261
if (styles == null) throw _KatexHtmlParseError();
258262
if (styles.verticalAlignEm != null) throw _KatexHtmlParseError();

0 commit comments

Comments
 (0)