From 59b9c5c296720e4a13bf3da1345d1381b133129e Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Fri, 25 Aug 2023 10:19:01 +0200 Subject: [PATCH] don't populate a first newline to properly parse blockqoute tags Signed-off-by: Maksim Sukharev --- src/components/NcRichText/NcRichText.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/NcRichText/NcRichText.vue b/src/components/NcRichText/NcRichText.vue index fd7e53e517..0b5c9079d3 100644 --- a/src/components/NcRichText/NcRichText.vue +++ b/src/components/NcRichText/NcRichText.vue @@ -218,8 +218,10 @@ export default { prefix: false, }) .processSync(this.useMarkdown + // In order to correctly show newlines in Markdown, + // each newline contains a non-breaking space ? this.text.slice().replace(/\n{2,}/g, (match) => { - return '\n\u00A0'.repeat(match.length - 1) + '\n' + return '\n' + '\n\u00A0\n'.repeat(match.length - 1) }) : this.text) .result