-
Notifications
You must be signed in to change notification settings - Fork 132
Add support for autolink (typing and pasting) #233
Comments
We need 2 things for this: 1. pasting urlsWe need url support but without the Quill editing UI: To enable ability to see urls in Quill add: diff --git a/src/sidebar/panel.js b/src/sidebar/panel.js
index e34b085..7353b85 100644
--- a/src/sidebar/panel.js
+++ b/src/sidebar/panel.js
@@ -1,6 +1,7 @@
const formats = [
'bold',
'font',
+ 'link',
'italic',
'size',
'strike', 2. typingWhen you type a url or copy something like this: Also:
|
As far as typing goes, I used the code outlined in this answer and it works pretty well. Based on the regex used in that code, only text beginning with Another note with the example code given in the above comment is that the typed text should be followed by whitespace (either a space or newline will do), otherwise any proceeding text may become a part of the link itself. One way of preventing this would be to implement the Cmd/CtrlK shortcut to allow toggling on and off linking for highlighted text.
Do you suggest removing that editing tooltip entirely, or replacing it with our own? |
That sounds good for starters 👍
That's also fine. I think G Docs might do this too.
If we can avoid the tooltip entirely that would be great. Due to the sidebar nature of the project we are trying to stay away from these tooltips :) |
This is the initial implementation for supporting links (mozilla#233). With these changes, links will automatically be created from anything that begins with `http://` or `https://`. That includes any typed or pasted text. The changes in the CSS make it so that the Quill link editing UI tooltip is no longer shown. In order to open a link, the user must mouse over the link and right-click for the context menu or `Ctrl/Cmd + Click` to open in a new tab.
Created a pull request with the basic support for links. Still need to add link mouse click events to the analytics. |
Fixed with 75c7514 |
Refs slab/quill#109 (comment)
The text was updated successfully, but these errors were encountered: