diff --git a/src/util/parseMessageInput.ts b/src/util/parseMessageInput.ts index b4f94640..65be282e 100644 --- a/src/util/parseMessageInput.ts +++ b/src/util/parseMessageInput.ts @@ -84,9 +84,18 @@ function parseMarkdown(html: string) { parsedHtml = parsedHtml.replace(/[`]{1}([^`\n]+)[`]{1}/g, '$1'); // Other simple markdown - parsedHtml = parsedHtml.replace(/[*]{2}([^*\n]+)[*]{2}/g, '$1'); - parsedHtml = parsedHtml.replace(/[_]{2}([^*\n]+)[_]{2}/g, '$1'); - parsedHtml = parsedHtml.replace(/[~]{2}([^~\n]+)[~]{2}/g, '$1'); + parsedHtml = parsedHtml.replace( + /(\s)(?)(\s|$)/g, + '$1$2$3', + ); + parsedHtml = parsedHtml.replace( + /(\s)(?)(\s|$)/g, + '$1$2$3', + ); + parsedHtml = parsedHtml.replace( + /(\s)(?)(\s|$)/g, + '$1$2$3', + ); return parsedHtml; }