// Copyright (c) 2020-2022 MathJax Consortium // SPDX-License-Identifier: Apache-2.0 // Source: ts/input/tex/mathtools/MathtoolsConfiguration.ts, fixPrescripts.
package tex import func fixPrescripts( *mml.Node) { .Walk(func( *mml.Node) bool { if .Kind != "mmultiscripts" { return true } if , := .Property("fixPrescript"); !limitsTruthy() { return true } := append([]*mml.Node(nil), .Children...) := 0 for , := range []int{1, 2} { if [] == nil { [] = node("none") ++ } } for , := range []int{4, 5} { := [] if .Kind == "mrow" && len(.Children) == 0 { [] = node("none") } } if == 2 { = append([:1], [3:]...) } .SetChildren() refreshDynamicFlags() return true }) }