File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
mathjax3-ts/core/MmlTree/MmlNodes Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,14 @@ export class MmlMtable extends AbstractMmlNode {
8484 }
8585 }
8686 display = ! ! ( this . attributes . getExplicit ( 'displaystyle' ) || this . attributes . getDefault ( 'displaystyle' ) ) ;
87- super . setChildInheritedAttributes ( attributes , display , level , prime ) ;
87+ attributes . columnalign = [ this . kind , this . attributes . get ( 'columnalign' ) ] ;
88+ attributes . rowalign = [ this . kind , 'center' ] ;
89+ const ralign = ( this . attributes . get ( 'rowalign' ) as string )
90+ . replace ( / ^ \s + / , '' ) . replace ( / \s + $ / , '' ) . split ( / + / ) ;
91+ for ( const child of this . childNodes ) {
92+ attributes . rowalign [ 1 ] = ralign . shift ( ) || attributes . rowalign [ 1 ] ;
93+ child . setInheritedAttributes ( attributes , display , level , prime ) ;
94+ }
8895 }
8996
9097 /*
Original file line number Diff line number Diff line change @@ -64,7 +64,14 @@ export class MmlMtr extends AbstractMmlNode {
6464 . appendChild ( child ) ;
6565 }
6666 }
67- super . setChildInheritedAttributes ( attributes , display , level , prime ) ;
67+ attributes . rowalign = [ this . kind , this . attributes . get ( 'rowalign' ) ] ;
68+ attributes . columnalign = [ this . kind , 'center' ] ;
69+ const calign = ( this . attributes . get ( 'columnalign' ) as string )
70+ . replace ( / ^ \s + / , '' ) . replace ( / \s + $ / , '' ) . split ( / + / ) ;
71+ for ( const child of this . childNodes ) {
72+ attributes . columnalign [ 1 ] = calign . shift ( ) || attributes . columnalign [ 1 ] ;
73+ child . setInheritedAttributes ( attributes , display , level , prime ) ;
74+ }
6875 }
6976
7077 /*
You can’t perform that action at this time.
0 commit comments