I am looking to create a customized input text feature similar to StackOverflow's tag editor, but with some minor differences. The goal is for the input field to function like a regular text input until a word is enclosed in curly brackets. Once enclosed, that word should transform into a "different element" with unique styling and behavior. For example, clicking on the enclosed word could trigger a popup dialog while the rest of the text remains unchanged.
How challenging would it be to develop this functionality? For instance:
Imagine typing "Lorem ipsum {dolor" and as soon as you close the curly bracket, "{dolor}" changes to have an orange background, becomes clickable, etc. (using "dolor" and "amet" within the curly brackets in this scenario)
This concept mirrors how the tag editor works on StackOverflow, though my version would not involve left-floating tags.
Have you come across anything similar or do you have examples or ideas to share?