To make it simple, I have a textbox where the user writes their code, the keywords are then rendered in with richtext to be a different colour, but it would cause problems if the player backspaced and deleted the rich text formating, which wouldn’t get re-formatted as the keyword isn’t strictly what it should be.
Basically my system right now is:
line input → formatting algorithmn → line output
What I need it to be:
line input → rich text filtered → formatting algorithmn → line output