KILabel icon indicating copy to clipboard operation
KILabel copied to clipboard

add handling of NSLinkAttributedName attribute for URL Link

Open vhosune opened this issue 10 years ago • 2 comments

add handling of NSAttributedString NSLinkAttributedName attribute as an URL link

vhosune avatar Jun 04 '15 10:06 vhosune

Thanks for doing this. It looks like a fairly straightforward addition.

I think there is one problem where we will end up with duplicate matches if the link text matches the regex and there is a link attribute as well.

When the link attributes block is called it should check the range of the match against the array of matches that was returned by the regex to avoid the clash.

If we don't do this then blocks could get called twice for the same range. The link classifiers should call their tap handler once for each detected range.

Cheers.

Krelborn avatar Jun 04 '15 10:06 Krelborn

It will take the first match

vhosune avatar Jun 09 '15 15:06 vhosune