fix: Render line-breaks properly in messages (#2699)
This commit is contained in:
@@ -144,7 +144,6 @@ export default {
|
|||||||
text_content: { full: fullTextContent, reply: replyTextContent } = {},
|
text_content: { full: fullTextContent, reply: replyTextContent } = {},
|
||||||
} = {},
|
} = {},
|
||||||
} = this.contentAttributes;
|
} = this.contentAttributes;
|
||||||
|
|
||||||
let contentToBeParsed =
|
let contentToBeParsed =
|
||||||
replyHTMLContent ||
|
replyHTMLContent ||
|
||||||
replyTextContent ||
|
replyTextContent ||
|
||||||
@@ -154,7 +153,7 @@ export default {
|
|||||||
if (contentToBeParsed && this.isIncoming) {
|
if (contentToBeParsed && this.isIncoming) {
|
||||||
const parsedContent = this.stripStyleCharacters(contentToBeParsed);
|
const parsedContent = this.stripStyleCharacters(contentToBeParsed);
|
||||||
if (parsedContent) {
|
if (parsedContent) {
|
||||||
return parsedContent;
|
return parsedContent.replace(/\n/g, '<br />');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
emailAttributes: {
|
emailAttributes: {
|
||||||
type: Array,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
isIncoming: {
|
isIncoming: {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class MessageFormatter {
|
|||||||
const markedDownOutput = marked(withHash);
|
const markedDownOutput = marked(withHash);
|
||||||
return markedDownOutput;
|
return markedDownOutput;
|
||||||
}
|
}
|
||||||
return marked(this.message);
|
return marked(this.message, { breaks: true, gfm: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
get formattedMessage() {
|
get formattedMessage() {
|
||||||
|
|||||||
@@ -126,5 +126,9 @@ export default {
|
|||||||
margin-top: $space-normal;
|
margin-top: $space-normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p:not(:last-child) {
|
||||||
|
margin-bottom: $space-normal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user