Skip to content

Commit

Permalink
fix(markdown): reply preview shows empty message when quoting multili…
Browse files Browse the repository at this point in the history
…ne code message
  • Loading branch information
juliahermak committed Nov 3, 2023
1 parent 12c1aab commit ac06c1b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || ''
}

0 comments on commit ac06c1b

Please sign in to comment.