Skip to content
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 lines into texteditor #2486

Merged
merged 1 commit into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ReplyBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import moment from '@nextcloud/moment'
import negate from 'lodash/fp/negate'

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

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

export const buildHtmlReplyBody = (original, from, date) => {
const start = `<p></p>`
const start = `<p></p><p></p>`
const body = `<blockquote>${original}</blockquote>`

if (from) {
Expand Down
4 changes: 2 additions & 2 deletions src/tests/unit/ReplyBuilder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {buildReplyBody, buildRecipients, buildReplySubject} from '../../ReplyBui
describe('ReplyBuilder', () => {
it('creates a reply body without any sender', () => {
const body = 'Newsletter\nhello\ncheers'
const expectedReply = '\n\n\n> Newsletter\n> hello\n> cheers'
const expectedReply = '<p></p><p></p><br>&gt; Newsletter<br>&gt; hello<br>&gt; cheers'

const replyBody = buildReplyBody(body)

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

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

const replyBody = buildReplyBody(
body,
Expand Down