fix: empty code blocks (#978)

This commit is contained in:
Kerunix 2023-01-11 21:55:47 +01:00 committed by GitHub
parent 689ae0c701
commit 67f58a3335
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,7 @@ export const isEmptyDraft = (draft: Draft | null | undefined) => {
return true
const { params, attachments } = draft
const status = params.status || ''
const text = htmlToText(status).trim().replace(/^(@\S+\s?)+/, '').trim()
const text = htmlToText(status).trim().replace(/^(@\S+\s?)+/, '').replaceAll(/```/g, '').trim()
return (text.length === 0)
&& attachments.length === 0