// Copyright (c) 2021-2022 The MathJax Consortium // SPDX-License-Identifier: Apache-2.0 // Sources: MathtoolsMethods.SpreadLines and MathtoolsUtil.spreadLines.
package tex import ( ) // Pop.toMml is selected before the result is pushed into any outer prefix. // Only a direct mtable or immediate inferred-row children receive spacing. // A nil spread denotes the absent property on a popped non-Begin stack item. func mathtoolsSpreadPop( *mml.Node, *string) error { for , := range unwrapInferred() { if .Kind != "mtable" { continue } , := .Attributes.Get("rowspacing") if !limitsTruthy() { // The source assigns undefined on this branch without calling // dimen2em. An explicit nil retains the absent effective value. var any if != nil { = * } .Attributes.Set("rowspacing", ) continue } if == nil { // dimen2em(undefined) throws at this first Pop, before any // subsequent token or closing-item reduction can run. return fmt.Errorf("spreadlines popped a table without a spread dimension") } mathtoolsAddRowSpacing(, *) } return nil } func mathtoolsSpreadPending( []*mml.Node) error { return mathtoolsSpreadPop(row(, true), nil) }