Skip to main content
Sign in
Snippets Groups Projects
Unverified Commit c1df1103 authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #2474 from nextcloud/fix/draft-newlines

Fix vanishing newlines of plaintext drafts
parents c3e63059 95037723
Branches
Tags
No related merge requests found
......@@ -419,6 +419,7 @@ class IMAPMessage implements IMessage, JsonSerializable {
'subject' => $this->getSubject(),
'dateInt' => $this->getSentDate()->getTimestamp(),
'flags' => $this->getFlags(),
'hasHtmlBody' => $this->hasHtmlMessage,
];
}
......
......
......@@ -64,7 +64,7 @@ export default {
bcc: this.draft.bcc, // TODO: impl in composer
subject: this.draft.subject,
body: this.draft.body,
isPlainText: this.draft.hasHtmlBody !== undefined,
isPlainText: !this.draft.hasHtmlBody,
}
} else if (this.$route.query.uid !== undefined) {
// Forward or reply to a message
......
......
......@@ -42,7 +42,7 @@ import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph'
import {getLanguage} from '@nextcloud/l10n'
import {htmlToText} from '../util/HtmlHelper'
import logger from '../logger'
export default {
name: 'TextEditor',
......@@ -130,13 +130,12 @@ export default {
// Set value as late as possible, so the custom schema listener is used
// for the initial editor model
if (this.html) {
this.text = this.value
} else {
this.text = `<p>${htmlToText(this.value).replace(/[\n\r]/gm, '<br>')}</p>`
}
logger.debug(`setting TextEditor contents to <${this.text}>`)
},
onInput() {
logger.debug(`TextEditor input changed to <${this.text}>`)
this.$emit('input', this.text)
},
},
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment