From ac06c1bd46ef496242ef8f2ec2dd54676247bbfb Mon Sep 17 00:00:00 2001 From: Yulia Hermak Date: Fri, 3 Nov 2023 21:48:55 +0000 Subject: [PATCH] fix(markdown): reply preview shows empty message when quoting multiline code message --- src/lib/markdown.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib/markdown.js b/src/lib/markdown.js index 12be19903..54bf0dda8 100644 --- a/src/lib/markdown.js +++ b/src/lib/markdown.js @@ -56,11 +56,8 @@ export function renderMarkdown (text = '') { * @returns {string} resulting clear text of the first line */ export function removeFormats (text = '') { - // get first line - const line = /^([^\n]*)\n?/.exec(text)[1] - const node = document.createElement('div') - node.innerHTML = marked(DOMPurify.sanitize(line), { renderer }) + node.innerHTML = marked(DOMPurify.sanitize(text), { renderer }) return node.textContent || node.innerText || '' }