I have an input and a textarea. Using Vue, I am currently setting the textarea's text to match what's in the input field. However, now I want to be able to change the color of specific text by typing something like {#123123}text{/#}
. At this point, I don't necessarily need the color change functionality, but I'm wondering how to identify the text between {#} and {/#} and wrap it in a div that changes its color.
I'm unsure where to begin with this task. My initial thought is to create a function that searches for {
, then identifies the text following it before locating }
. Nevertheless, I am uncertain about the best approach to achieving this.