Fix spacer insertion condition in table cell loop

Changed the condition to insert a spacer only when a table row has at least two cells, preventing out-of-bounds errors when accessing the second cell.
This commit is contained in:
Lakr
2025-07-03 15:13:23 +09:00
parent 1e49ab4e85
commit cfd646dcac

View File

@@ -848,7 +848,7 @@ public class MTMathAtomFactory {
let spacer = MTMathAtom(type: .ordinary, value: "")
for i in 0..<table.cells.count {
if table.cells[i].count >= 1 {
if table.cells[i].count >= 2 {
table.cells[i][1].insert(spacer, at: 0)
}
}