Talk, guys .. Blz? I have a question here. I'm developing a chat app in vue, and let's say I send or receive a message like this:
msg = "Oi, fulano. Acesse esse <a href="link">link</a> e digite <span>Meu nome é <a href="teste">teste</a></span>. Depois disso, vá até tal lugar e então cole o código <header> <div class="title text-center"><h1>Testando</h1></div> </header>."
When rendering the message, the link, span, h1, etc. will be created. Is there any way I can, for example, 'scan' the whole message and check all tags, elements, scripts, and so on. start different from and end with I add the tag code in the front and the end? Alas, in this case, the following message would look like this:
Hi, so and so. Go to this link and type <code><span>Meu nome é <a href="teste">teste</a></span><code>
. After that, go to that place and then paste the code <code><header> <div class="title text-center"><h1>Testando</h1></div> </header></code>.
That is, he checked that there is a link and did nothing, then verified that there is a span tag, found everything inside it and added it inside a tag code .. continued, he saw that there is a header tag, found the end of it and added it inside a tag code. I tried with regex and I could not even in the bullet .. If anyone can give me a help ..