SwiftDown icon indicating copy to clipboard operation
SwiftDown copied to clipboard

Enable detected links as actual links

Open garrettmurray opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. One expectation of a Markdown preview is that links are actually clickable when they're identified and displayed as links.

Describe the solution you'd like Two possible ways to solve this as I think about it (conveniently without any concern about implementation 😆):

A. Add logic to wrap detected link nodes in their link so that the entire [Text](https://link) is linked as a single unit (this seems complex). Or B. Allow for the isAutomaticLinkDetectionEnabled attribute of NSTextView to be utilized (and the UIDataDectorTypes.link equivalent on iOS) which would only link the actual URL from the link, but would at least still make the link clickable.

Seems like B would be much easier and get 90% of the way there, though it's less accurate to the preview technically. Would still be preferable, I think, to no linking at all, however.

Describe alternatives you've considered Obviously, this isn't a blocker to using SwiftDownEditor, but it does mean one of the core features of Markdown doesn't actually do anything when you match it, which is odd.

garrettmurray avatar Feb 18 '24 23:02 garrettmurray

Hey @garrettmurray, Thanks for your feature request! Indeed it would be a great improvement. Don't hesitate to raise a PR, I think I won't have much time in the coming days to implement this, but would be happy to have a look as someone's PR on that 🙏

qeude avatar Feb 19 '24 08:02 qeude