Okay yes, that makes sense! For this particular case, I’m not 100% sure how you would best solve this through UI customisations (without reinventing the whole rendering logic). Each highlightable unit is a token and if a token only contains a newline, it becomes a “special” newline token – which is already kind of an exception to the otherwise very tight coupling of incoming data and rendering. This is by design, because every small modification the app makes to the incoming data when rendering it can potentially have an impact on consistency and quality of the annotations (especially if they’ll be used for machine learning).
So for this case, it might be easiest to just provide additional tokenization that expresses how you want to display the tokens? For example, you could have
"tokens", which is your modified custom tokenization that’s displayed (with added newline tokens) and
"orig_tokens", which is the original tokenization aligned with the text.
But I’ll think about this some more, maybe I’ll come up with a better idea!