diff --git a/lib/Service/MimeMessage.php b/lib/Service/MimeMessage.php index 1188d18500..48e3fec205 100644 --- a/lib/Service/MimeMessage.php +++ b/lib/Service/MimeMessage.php @@ -100,7 +100,7 @@ private function buildMessagePart(?string $contentPlain, ?string $contentHtml, a $plainPart->setType('text/plain'); $plainPart->setCharset('UTF-8'); $plainPart->setContents( - Horde_Text_Filter::filter($contentHtml, 'Html2text', ['callback' => [$this, 'htmlToTextCallback']]) + Horde_Text_Filter::filter($contentHtml, 'Html2text', []) ); } @@ -258,23 +258,4 @@ private function separateAttachments(array $attachments): array { return [$inline, $normal]; } - - /** - * A callback for Horde_Text_Filter. - * - * The purpose of this callback is to overwrite the default behavior - * of html2text filter to convert
Hello
=> Hello\n\n with - *Hello
=> Hello\n. - * - * @param DOMDocument $doc - * @param DOMNode $node - * @return string|null non-null, add this text to the output and skip further processing of the node. - */ - public function htmlToTextCallback(DOMDocument $doc, DOMNode $node) { - if ($node instanceof DOMElement && strtolower($node->tagName) === 'p') { - return $node->textContent . "\n"; - } - - return null; - } } diff --git a/src/ckeditor/mail/MailPlugin.js b/src/ckeditor/mail/MailPlugin.js deleted file mode 100644 index ca04e34a25..0000000000 --- a/src/ckeditor/mail/MailPlugin.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -import { Paragraph, Plugin } from 'ckeditor5' - -export default class Mail extends Plugin { - static get requires() { - return [Paragraph] - } - - init() { - this._overwriteParagraphConversion() - } - - /** - * Overwrite the elementToElement conversion - * from the default paragraph plugin to add - * margin:0 to every. - * - * @private - */ - _overwriteParagraphConversion() { - this.editor.conversion.elementToElement({ - model: 'paragraph', - view: { - name: 'p', - styles: { - margin: 0, - }, - }, - converterPriority: 'high', - }) - } -} diff --git a/src/components/TextEditor.vue b/src/components/TextEditor.vue index 02cc57bc7d..0f4a749c76 100644 --- a/src/components/TextEditor.vue +++ b/src/components/TextEditor.vue @@ -53,7 +53,6 @@ import { } from 'ckeditor5' import { getLinkWithPicker, searchProvider } from '@nextcloud/vue/components/NcRichText' import TextDirectionPlugin from '../ckeditor/direction/TextDirectionPlugin.js' -import MailPlugin from '../ckeditor/mail/MailPlugin.js' import QuotePlugin from '../ckeditor/quote/QuotePlugin.js' import SignaturePlugin from '../ckeditor/signature/SignaturePlugin.js' import PickerPlugin from '../ckeditor/smartpicker/PickerPlugin.js' @@ -152,7 +151,6 @@ export default { Font, RemoveFormat, Base64UploadAdapter, - MailPlugin, TextDirectionPlugin, ]) toolbar.unshift(...[ @@ -600,6 +598,11 @@ export default { cursor: text; margin: 0 !important; } + +// Show empty lines correctly in composer +:deep(p + p) { + margin-top: 1em !important; +}