-
Notifications
You must be signed in to change notification settings - Fork 262
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
Add image support to the text editor #6935
Conversation
00210d2
to
61d3e18
Compare
oof nice title though |
494ade7
to
f8d58ba
Compare
6d6f76e
to
f6d9ad1
Compare
ddd042c
to
3c542a1
Compare
Expected: the image appears |
✔️ Successfully tested embedding an image into a new HTML message |
We answered that, right? If there is content, the editing mode won't switch with the selection of another account. If the body is empty we switch modes according to account defaults. |
Definitely. Does CKEditor have an option for this or allow us to hook into the selection? |
3c542a1
to
aa2a4e2
Compare
Adjusted the title so it can be found in the browser history |
Let's do this as a follow-up so the basic image support can be part of this week's RC 👍 |
Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
isLimit prevent editing the current signature element. The CKEditor documentation says that a limit element is something like an image caption and adds boundaries to some internal actions (e.g a selection does not end outside or delete does not delete the area). Signature is a collection of related blocks. Make our signature schema behave like a $container is eventually the better choice here. Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
1) Adjust editor mode on alias change Changing an alias is simple when current and new alias use the same editor mode. Update alias object and trigger the signature plugin. When the current alias uses text but the new alias richtext we automatically change the editor mode to html. TextEditor uses :key="editorMode" to assign the instance to an editorMode. On :key change the old instance is destroyed and a new instance created. This emit another onEditorReady event and will trigger the signature plugin. To replace an existing signature changeSignature is true and set TRIGGER_CHANGE_ALIAS for the signature command. 2) Add warning on disable formatting When you compose a richtext message and disable formatting a warning is shown that formatting is lost. Enable formatting ActionCheckbox is now replaced by buttons with icons. Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
Otherwise it's not possible to open a draft with a webp image Signed-off-by: Daniel Kesselberg <[email protected]>
DOMPurify.sanitize may re-order the attributes. For example: <img src="data:image/png;base64,..." alt="Test" /> to <img alt="Test" src="data:image/png;base64,...">> CKEditor always adds the alt attribute after src attribute. Internal (CKEditor) and external (TextEditor) are different and every keystroke will emit a second event. Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
410cf5b
to
e07de49
Compare
DOMPurify.sanitize may take a while. Save some sanitize executions by moving the sanitization to an earlier stage. Signed-off-by: Daniel Kesselberg <[email protected]>
d877f3d
to
ea90bc1
Compare
Signed-off-by: Daniel Kesselberg <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested & works
Fixes #2733
Fixes #2052
Changes
To do
mail: setting TextEditor contents to <undefined>
To discuss
Use the new HTML2Text dependency for html-to-text conversion instead of horde filter?Caption/Alt for Image? A possible use case is the attachment nameAdd a warning for images > 128kb? (big base64 encoded images make the editor laggy and slow down sending)ca38fb7 add debounce for onInput eventTest cases
1. Open draft
Expected result: Image is there. It's possible to add further images, delete existing images and write more text.
2. Write message
Expected result: Message is in the outbox. Image is there. A
multipart/related
email is sent. K-9, Thunderbird, Roundcube show the message properly.To rebase the branch with main
npm install @ckeditor/ckeditor5-image @ckeditor/ckeditor5-upload @ckeditor/ckeditor5-vue2@^3.0.1
git add package.json package-lock.json
git commit --signoff -m "Add ckeditor upload and image as dependency"