docx icon indicating copy to clipboard operation
docx copied to clipboard

Fix multiple splits in a single run

Open FuegoFro opened this issue 2 months ago • 2 comments

There was an issue where the way split index was the last item being split, which broken when we separated items into left/right, leading to overwritten values or "token not found" errors.

This stops us searching the run as soon as we find a place to split, and also guarantees that we don't try to start looking for a split past the end of the paragraph.

I've added a test that reproduces the issue, and then fixed the implementation such that the test passes.

FuegoFro avatar Nov 06 '25 21:11 FuegoFro

@FuegoFro Thanks for this! Could you look into this failing test?

dolanmiu avatar Nov 21 '25 13:11 dolanmiu

Ah sorry about the delay here! I went ahead and updated the test to match the new behavior. That being said, that does mean there's a slight change in output when not finding a split, and I don't know if anyone might be relying on the existing behavior. If so, I can also add a quick special case to put everything on the left instead of the right when no split is found!

FuegoFro avatar Dec 09 '25 21:12 FuegoFro