Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable detected links as actual links #35

Open
garrettmurray opened this issue Feb 18, 2024 · 1 comment
Open

Enable detected links as actual links #35

garrettmurray opened this issue Feb 18, 2024 · 1 comment

Comments

@garrettmurray
Copy link

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.

@qeude
Copy link
Owner

qeude commented Feb 19, 2024

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 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants