Closed vgupt122 closed 1 year ago
Do you mean that the hashtags and mentions are working but the links not? Is your HTML using <a href markup? Then if so the matchLinks will only find thelinks inside your HTML tags. In your sample Vivek Gupta it will find the https://www.someurlink?username=12345 and make that clickable. but your html rendering will hide that part and only show Vivek Gupta and that will look like a link because of the HTML rendering, but you won't be able to click it. The .html will use the basic NSAttributedText functionality for parsing html to an NSAttributedTekst. I'm not sure if there is a way to find all links inside that parsed tekst. If you know what text would be inside the link, then you could search for that and make that clickable. So find Vivek Gupta and execute a .makeInteract on that.
Sure! I will try.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Edwin Vermeer notifications@github.com Sent: Sunday, January 10, 2021 2:18:16 PM To: evermeer/AttributedTextView AttributedTextView@noreply.github.com Cc: Gupta, Vivek N vivek.gupta122@optum.com; Author author@noreply.github.com Subject: Re: [evermeer/AttributedTextView] Anchor tags are not clickable (only detected as html link) (#35)
Do you mean that the hashtags and mentions are working but the links not? Is your HTML using <a href markup? Then if so the matchLinks will only find thelinks inside your HTML tags. In your sample Vivek Guptahttps://www.someurlink?username=12345 it will find the https://www.someurlink?username=12345 and make that clickable. but your html rendering will hide that part and only show Vivek Gupta and that will look like a link because of the HTML rendering, but you won't be able to click it. The .html will use the basic NSAttributedText functionality for parsing html to an NSAttributedTekst. I'm not sure if there is a way to find all links inside that parsed tekst. If you know what text would be inside the link, then you could search for that and make that clickable. So find Vivek Gupta and execute a .makeInteract on that.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/evermeer/AttributedTextView/issues/35#issuecomment-757440345, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQ5V6ITF5IB27KY4H2RL6IDSZFSVBANCNFSM4UKNJRKQ.
This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.
In The below example Anchor tags are detected as html link but not clickable <a href=\'https://www.someurlink?username=12345'>Vivek Gupta
I used like below
the 'text' variable has html string.
Has anyone got this issue. Please help.