While posting I noticed that your text editor can insert code snippets via the icon “</>”, but the vaadin RichTextArea component does not have this.
Can this configured or do I have to use a completely different component?
I found syntax hightlighting addon:
https://vaadin.com/directory/component/codemirror
Is this what is being used in this forum?