1
Speak, guys.. Blz? I have a question here. I am developing a chat app on Youtube, and say I send or receive a message as follows:
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 to, for example, I 'sweep' the whole message and check all the tags, elements, scripts, anyway , and what to start other than and finish with I add the tag code in front and at the end? 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 such a place and then paste the code <code><header> <div class="title text-center"><h1>Testando</h1></div> </header></code>.
That is, he verified that there is a link and did nothing, then checked that there is a span tag, found everything that is inside it and added it inside a code tag.. continued, saw that there is a header tag, found the end of it and added it inside a tag code. I tried with regex and could not even in the bullet.. If anyone can give me a help. <3
I didn’t quite understand the question, can you review and explain the input code/string better and how do you want the result? o
<a>
should not stay<code><a></code>
?– Sergio
That, Sergio! Links (a) should not be inside code. HOWEVER, if this link is inside any other tag, then it is enclosed along with the code!
– Rafael Pelizza