Links not rendering
ℹ Please fill out this template when filing an issue. All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.
Per our *CONTRIBUTING guidelines, we use GitHub for bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag
cdmarkdownkit.Please remove this line and everything above it before submitting.
- [x] I've read, understood, and done my best to follow the *CONTRIBUTING guidelines.
What did you do?
Tried to parse links
What did you expect to happen?
I expect [Link](somelink.com) to render as Link with whatever styling i set
What happened instead?
The styling is not applied. Also if the link is the only thing being parsed it is not recognised as a link as the regex expects it to be prefixed with some character.
CDMarkdownKit Environment
CDMarkdownKit version: 1.2.1 Xcode version: 10.2 Swift version: 4.2 Platform(s) running CDMarkdownKit: iOS 12.1 iPhone XS macOS version running Xcode: 10.14.3, macOS Mojave
If you want to set the style of a link then you have to set UITextView.linkTextAttributes by yourself. This can't be set inside the markdown rendering because the UITextView handles links in its own way.
The Documentation says:
The default attributes specify blue text with a single underline and the pointing hand cursor.
Hello! The same happens using UILabel. Any idea to solve this issue? Thanks
I found a solution. It appear to be an iOS bug when we use NSAttributedString.Key.link. The workaround it to change from .link to .attachment here
func addLink(_ link: URL,
toRange range: NSRange) {
self.addAttribute(NSAttributedString.Key.attachment,
value: link,
range: range)
}
Hello, i have the same bug
if my string starts from link for example [google](https://google.com) that link won't be parsed but if i put something before for example text, it will parse as expected
Thank you for your comments. I will try and look into this soon.
CDMarkdownKit Environment
CDMarkdownKit version: 2.5.1 (from swift package) Xcode version: Version 14.1 (14B47b) Swift version: last Platform(s) running CDMarkdownKit: iOS 16.1 iPhone 14 Pro macOS version running Xcode: 13.0.1 (22A400), macOS Ventura
Hello, i have the same bug
if my string starts from link for example
[google](https://google.com)that link won't be parsed but if i put something before for example text, it will parse as expected
Any updates about that bug?