Skip to content

Commit 2844631

Browse files
committed
Merge remote-tracking branch 'pr/1452'
2 parents efdfbea + 0a66a8d commit 2844631

File tree

5 files changed

+1047
-132
lines changed

5 files changed

+1047
-132
lines changed

lib/model/content.dart

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,12 @@ abstract class MathNode extends ContentNode {
369369
}
370370
}
371371

372-
class KatexNode extends ContentNode {
373-
const KatexNode({
372+
sealed class KatexNode extends ContentNode {
373+
const KatexNode({super.debugHtmlNode});
374+
}
375+
376+
class KatexSpanNode extends KatexNode {
377+
const KatexSpanNode({
374378
required this.styles,
375379
required this.text,
376380
required this.nodes,
@@ -402,6 +406,55 @@ class KatexNode extends ContentNode {
402406
}
403407
}
404408

409+
class KatexStrutNode extends KatexNode {
410+
const KatexStrutNode({
411+
required this.heightEm,
412+
required this.verticalAlignEm,
413+
super.debugHtmlNode,
414+
});
415+
416+
final double heightEm;
417+
final double? verticalAlignEm;
418+
419+
@override
420+
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
421+
super.debugFillProperties(properties);
422+
properties.add(DoubleProperty('heightEm', heightEm));
423+
properties.add(DoubleProperty('verticalAlignEm', verticalAlignEm));
424+
}
425+
}
426+
427+
class KatexVlistNode extends KatexNode {
428+
const KatexVlistNode({
429+
required this.rows,
430+
super.debugHtmlNode,
431+
});
432+
433+
final List<KatexVlistRowNode> rows;
434+
435+
@override
436+
List<DiagnosticsNode> debugDescribeChildren() {
437+
return rows.map((row) => row.toDiagnosticsNode()).toList();
438+
}
439+
}
440+
441+
class KatexVlistRowNode extends ContentNode {
442+
const KatexVlistRowNode({
443+
required this.verticalOffsetEm,
444+
required this.node,
445+
super.debugHtmlNode,
446+
});
447+
448+
final double verticalOffsetEm;
449+
final KatexSpanNode node;
450+
451+
@override
452+
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
453+
super.debugFillProperties(properties);
454+
properties.add(DoubleProperty('verticalOffsetEm', verticalOffsetEm));
455+
}
456+
}
457+
405458
class MathBlockNode extends MathNode implements BlockContentNode {
406459
const MathBlockNode({
407460
super.debugHtmlNode,

0 commit comments

Comments
 (0)