Skip to content

Commit b43d599

Browse files
committed
Add lines into texteditor and fix test
Signed-off-by: GretaD <[email protected]>
1 parent 9ff714a commit b43d599

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ReplyBuilder.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import moment from '@nextcloud/moment'
2424
import negate from 'lodash/fp/negate'
2525

2626
export const buildReplyBody = (original, from, date) => {
27-
const start = '\n\n'
28-
const body = '\n> ' + original.replace(/\n/g, '\n> ')
27+
const start = '<p></p><p></p>'
28+
const body = '<br>&gt; ' + original.replace(/\n/g, '<br>&gt; ')
2929

3030
if (from) {
3131
const dateString = moment.unix(date).format('LLL')
@@ -36,7 +36,7 @@ export const buildReplyBody = (original, from, date) => {
3636
}
3737

3838
export const buildHtmlReplyBody = (original, from, date) => {
39-
const start = `<p></p>`
39+
const start = `<p></p><p></p>`
4040
const body = `<blockquote>${original}</blockquote>`
4141

4242
if (from) {

src/tests/unit/ReplyBuilder.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {buildReplyBody, buildRecipients, buildReplySubject} from '../../ReplyBui
2525
describe('ReplyBuilder', () => {
2626
it('creates a reply body without any sender', () => {
2727
const body = 'Newsletter\nhello\ncheers'
28-
const expectedReply = '\n\n\n> Newsletter\n> hello\n> cheers'
28+
const expectedReply = '<p></p><p></p><br>&gt; Newsletter<br>&gt; hello<br>&gt; cheers'
2929

3030
const replyBody = buildReplyBody(body)
3131

@@ -34,7 +34,7 @@ describe('ReplyBuilder', () => {
3434

3535
it('creates a reply body', () => {
3636
const body = 'Newsletter\nhello'
37-
const expectedReply = '\n\n"Test User" [email protected] – November 5, 2018 '
37+
const expectedReply = '<p></p><p></p>"Test User" [email protected] – November 5, 2018 '
3838

3939
const replyBody = buildReplyBody(
4040
body,

0 commit comments

Comments
 (0)