@@ -224,10 +224,18 @@ class _KatexParser {
224
224
dom.Element (localName: 'span' , className: 'vlist-r' , nodes: [
225
225
dom.Element (localName: 'span' , className: 'vlist' , nodes: [
226
226
dom.Element (localName: 'span' , className: '' , nodes: []),
227
- ]),
227
+ ]) && final vlist ,
228
228
]),
229
229
]) {
230
- // Do nothing.
230
+ // In the generated HTML the .vlist in second .vlist-r span will have
231
+ // a "height" inline style which we ignore, because it doesn't seem
232
+ // to have any effect in rendering on the web.
233
+ // But also make sure there aren't any other inline styles present.
234
+ final vlistStyles = _parseSpanInlineStyles (vlist);
235
+ if (vlistStyles != null
236
+ && vlistStyles.filter (heightEm: false ) != const KatexSpanStyles ()) {
237
+ throw _KatexHtmlParseError ();
238
+ }
231
239
} else {
232
240
throw _KatexHtmlParseError ();
233
241
}
@@ -241,6 +249,17 @@ class _KatexParser {
241
249
if (vlistR.nodes.first
242
250
case dom.Element (localName: 'span' , className: 'vlist' ) &&
243
251
final vlist) {
252
+ // Same as above for the second .vlist-r span, .vlist span in first
253
+ // .vlist-r span will have "height" inline style which we ignore,
254
+ // because it doesn't seem to have any effect in rendering on
255
+ // the web.
256
+ // But also make sure there aren't any other inline styles present.
257
+ final vlistStyles = _parseSpanInlineStyles (vlist);
258
+ if (vlistStyles != null
259
+ && vlistStyles.filter (heightEm: false ) != const KatexSpanStyles ()) {
260
+ throw _KatexHtmlParseError ();
261
+ }
262
+
244
263
final rows = < KatexVlistRowNode > [];
245
264
246
265
for (final innerSpan in vlist.nodes) {
0 commit comments