@@ -341,6 +341,11 @@ class CodeBlockSpanNode extends ContentNode {
341
341
}
342
342
}
343
343
344
+ /// A complete KaTeX math expression within Zulip content,
345
+ /// whether block or inline.
346
+ ///
347
+ /// The content nodes that are descendants of this node
348
+ /// will all be of KaTeX-specific types, such as [KatexNode] .
344
349
sealed class MathNode extends ContentNode {
345
350
const MathNode ({
346
351
super .debugHtmlNode,
@@ -374,10 +379,15 @@ sealed class MathNode extends ContentNode {
374
379
}
375
380
}
376
381
382
+ /// A content node that expects a generic KaTeX context from its parent.
383
+ ///
384
+ /// Each of these will have a [MathNode] as an ancestor.
377
385
sealed class KatexNode extends ContentNode {
378
386
const KatexNode ({super .debugHtmlNode});
379
387
}
380
388
389
+ /// A generic KaTeX content node, corresponding to any span in KaTeX HTML
390
+ /// that we don't otherwise specially handle.
381
391
class KatexSpanNode extends KatexNode {
382
392
const KatexSpanNode ({
383
393
this .styles = const KatexSpanStyles (),
@@ -411,6 +421,7 @@ class KatexSpanNode extends KatexNode {
411
421
}
412
422
}
413
423
424
+ /// A KaTeX strut, corresponding to a `span.strut` node in KaTeX HTML.
414
425
class KatexStrutNode extends KatexNode {
415
426
const KatexStrutNode ({
416
427
required this .heightEm,
@@ -429,6 +440,12 @@ class KatexStrutNode extends KatexNode {
429
440
}
430
441
}
431
442
443
+ /// A KaTeX "vertical list", corresponding to a `span.vlist-t` in KaTeX HTML.
444
+ ///
445
+ /// These nodes in KaTeX HTML have a very specific structure.
446
+ /// The children of these nodes in our tree correspond in the HTML to
447
+ /// certain great-grandchildren (certain `> .vlist-r > .vlist > span` )
448
+ /// of the `.vlist-t` node.
432
449
class KatexVlistNode extends KatexNode {
433
450
const KatexVlistNode ({
434
451
required this .rows,
@@ -443,6 +460,11 @@ class KatexVlistNode extends KatexNode {
443
460
}
444
461
}
445
462
463
+ /// An element of a KaTeX "vertical list"; a child of a [KatexVlistNode] .
464
+ ///
465
+ /// These correspond to certain `.vlist-t > .vlist-r > .vlist > span` nodes
466
+ /// in KaTeX HTML. The [KatexVlistNode] parent in our tree
467
+ /// corresponds to the `.vlist-t` great-grandparent in the HTML.
446
468
class KatexVlistRowNode extends ContentNode {
447
469
const KatexVlistRowNode ({
448
470
required this .verticalOffsetEm,
@@ -465,6 +487,11 @@ class KatexVlistRowNode extends ContentNode {
465
487
}
466
488
}
467
489
490
+ /// A KaTeX node corresponding to negative values for `margin-left`
491
+ /// or `margin-right` in the inline CSS style of a KaTeX HTML node.
492
+ ///
493
+ /// The parser synthesizes these as additional nodes, not corresponding
494
+ /// directly to any node in the HTML.
468
495
class KatexNegativeMarginNode extends KatexNode {
469
496
const KatexNegativeMarginNode ({
470
497
required this .leftOffsetEm,
0 commit comments