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

wymeditor: Automatically generate link when pasting URL #379

Open
matthijskooijman opened this issue Apr 24, 2021 · 0 comments
Open

wymeditor: Automatically generate link when pasting URL #379

matthijskooijman opened this issue Apr 24, 2021 · 0 comments

Comments

@matthijskooijman
Copy link
Contributor

To make it easier to put proper links in articles, it would be nice if pasting a URL would automatically become a link.

Some constraints:

  • This should probably happen exclusively when the entire clipboard text is a link, trying to find links in a larger piece of text is prone to be wrong.
  • This should probably be limited to http:// and https:// links, trying to handle arbitrary protocols probably leads to false positives.
  • There is the question of what text to use for the link. Just the URL itself is always possible, but for internal links the page name would be nice (this would require adding an AJAX endpoint or so to retrieve it). For external links, maybe the browser could fetch the page in the background and use the title, though I'm not sure if that's feasible (or really adds something).
  • This bypasses the regular link dialog, so you cannot add a title or relation to the link (unless you somehow open the link editor/inserter after/instead of inserting the link maybe).
  • This can probably be done in the paste handler that was added as part of wymeditor: Adds paste listener to strip superfluous code #345. Since that already lives in Hypha code (not wymeditor code), adding hypha-specific things (such as page title lookups for internal links) is not a problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant