Building a performant, non-HTML-based WYSIWYG editor in Python is a challenging UI engineering problem. Improve the internal data structure for real-time document editing.