// Copyright (c) 2009-2022 The MathJax Consortium // SPDX-License-Identifier: Apache-2.0 // Source: ts/input/tex/base/BaseItems.ts ArrayItem.EndRow/EndTable.
package tex import // An explicit row separator always closes the pending entry, even if it is // empty. EndTable closes it only when nodes or previously closed entries // remain. Each mtd owns an inferred content row: an empty explicit group, // style, or leaf mspace is still an emitted node and must not be discarded. func omitFinalArrayRow(, int, []*mml.Node) bool { return == -1 && emptyArrayCells() } func emptyArrayCells( []*mml.Node) bool { if len() != 1 { return len() == 0 } for , := range [0].Children { if .Kind != "mrow" || !.Flags.Inferred || len(.Children) != 0 { return false } } return true }