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:
@@ -848,7 +848,7 @@ public class MTMathAtomFactory {
|
|||||||
let spacer = MTMathAtom(type: .ordinary, value: "")
|
let spacer = MTMathAtom(type: .ordinary, value: "")
|
||||||
|
|
||||||
for i in 0..<table.cells.count {
|
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)
|
table.cells[i][1].insert(spacer, at: 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user