// Copyright 2017-2022 The MathJax Consortium // SPDX-License-Identifier: Apache-2.0 // Based on Stack.Push, PhysicsMethods.AutoClose and BaseItems.PositionItem.
package tex import // autoclose belongs to the source MmlItem, not its MML node. A recipient may // replay the same item after changing its node, or replace it with a new item. type finalItem struct { node *mml.Node autoclose byte } func finalItems( []*mml.Node) []finalItem { := make([]finalItem, 0, len()) for , := range { if != nil { = append(, finalItem{node: }) } } return } func ( *positionItem) ( finalItem) []finalItem { if .left != nil { // Horizontal Position replays the identical incoming MmlItem. return []finalItem{{node: .left}, , {node: .right}} } // Vertical Position creates a new item around mpadded; no item properties // are copied from the consumed incoming item. return finalItems(.apply(.node)) }