chrisdhaan / CDMarkdownKit

An extensive Swift framework providing simple and customizable markdown parsing.
MIT License
254 stars 65 forks source link

Link not clickable #39

Closed adeds closed 2 years ago

adeds commented 2 years ago

What did you do?

I've tried the sample project, then I create and render a simple markdown, like "This framework helps with parsing markdown with Link."

What did you expect to happen?

the Link is clickable

What happened instead?

it is not clickable because displayActionController is not triggered <- selectedURLRange = nil <- boundingReact is not contains the correctLocation

image image

CDMarkdownKit Environment

CDMarkdownKit version: 2.3.0 Xcode version: 14.0.1 Swift version: swift-driver version: 1.62.8 Apple Swift version 5.7 (swiftlang-5.7.0.127.4 clang-1400.0.29.50) Platform(s) running CDMarkdownKit: iOS macOS version running Xcode: 12.6

ilgaputra15 commented 2 years ago

I had the same problem if using CDMarkdownLabel. You can try using UITextView with non editable configuration, and use UITextViewDelegate to handle redirect link

Configuration

Screen Shot 2022-10-25 at 11 30 16 Screen Shot 2022-10-25 at 11 41 01

Result

https://user-images.githubusercontent.com/37990848/197683855-3ba436a4-fc67-4763-8719-05d35591dee9.mp4

adeds commented 2 years ago

Works like a charm!

thanks a lot @ilgaputra15