SimonFairbairn / SwiftyMarkdown

Converts Markdown files and strings into NSAttributedStrings with lots of customisation options.
MIT License
1.63k stars 269 forks source link

Fix crash with invalid URL #102

Open kushak opened 3 years ago

kushak commented 3 years ago

I have a crash when adding and the attribute is an invalid link. This crash can be caught right in the example project if you change the link in the example.md file [Links](http://voyagetravelapps.com/) -> [Links](http://voyagetravelapps.com/ ) (with spacing). The same crash occurs with the text view when the delegate method is called func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange, interaction: UITextItemInteraction) -> Bool

My example image