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

[UX] Automatically convert pasted URLs into web-links #818

Closed
nil0x42 opened this issue Jan 10, 2020 · 6 comments
Closed

[UX] Automatically convert pasted URLs into web-links #818

nil0x42 opened this issue Jan 10, 2020 · 6 comments

Comments

@nil0x42
Copy link
Contributor

nil0x42 commented Jan 10, 2020

I spend half of my time in trilium pasting URLs. Therefore, they are not converted to links automatically, which is annoying.

So each time i paste a link, i need to:

  1. highlight the link
  2. press Ctrl+C
  3. press Ctrl+K
  4. press Ctrl+V

Converting pasted links to web-links automatically would be a great time saver

@zadam
Copy link
Owner

zadam commented Jan 10, 2020

I agree this would be very useful, but it is mostly an editing component feature. This is tracked in ckeditor/ckeditor5#4715

@safesparrow
Copy link

I would really like that feature too.

ckeditor/ckeditor5#4715 seems to be ignored by the ckeditor team for a few years now, which seems weird as it appears to be a simple change.
Given that CKEditor is not an open source project (?), would it be possible to hack this functionality into Trilium itself?
I guess that would require intercepting 'paste' events on the editor component and using either https://www.npmjs.com/package/linkifyjs or https://github.com/twitter/twitter-text/tree/master/js but shouldn't be too bad. If it gets tricky or doesn't work properly 100% of the time, it would be a good fit for an optional feature controlled through the config. If that's something that you would consider @zadam , I can have a look into hacking this and raise a PR.

Does the current use of CKEditor allow for this kind of manipulation? (I guess so, as you can do it outside of the editor component and not touch anything inside).

@zadam
Copy link
Owner

zadam commented Mar 5, 2020

You can give it a go. Ideally this would be in the form of a CKEditor plugin.

BTW, CKEditor is licensed under GPL 2+ and as such is fully open source. You can find all the source code on github.

@safesparrow
Copy link

Could you point me to the source code project?
https://github.com/ckeditor/ckeditor5 doesn't contain the source - just examples and docs (whcih are GPL 2+). Possible that I'm missing something obvious, sorry.

@zadam
Copy link
Owner

zadam commented Mar 5, 2020

CKEditor is built on plugin architecture, each plugin as a separate repo, e.g. https://github.com/ckeditor/ckeditor5-engine https://github.com/ckeditor/ckeditor5-link https://github.com/ckeditor/ckeditor5-code-block etc. You can see all of them here: https://github.com/ckeditor/

@zadam
Copy link
Owner

zadam commented Jul 29, 2020

Fixed in stable branch.

@zadam zadam closed this as completed Jul 29, 2020
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

4 participants