Color specific words in Input Field

I want my User to be able to write in the input field and specific words to be coloured differently - like Syntax Highlighting. However, if I do this in the OnValueChanged Method, this method gets executed again, because I add the attribute. This leads to a StackOverflow Exception.

Do you have any suggestions?

Thank you in advance!

Yes you can!

Have you tried this?

https://docs.unity3d.com/Manual/StyledText.html

Example

We are  <color=#00ffffff>not</color> <b>amused</b