From bc10b6deb8f9f0b5b2172cdbac3f1d102ecdccb5 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Thu, 26 Aug 2021 16:25:14 +0300 Subject: [PATCH] Fix editing monospace text --- src/helpers/dom/getRichElementValue.ts | 2 +- src/scss/partials/_chat.scss | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/helpers/dom/getRichElementValue.ts b/src/helpers/dom/getRichElementValue.ts index 4222469c..39404d99 100644 --- a/src/helpers/dom/getRichElementValue.ts +++ b/src/helpers/dom/getRichElementValue.ts @@ -30,7 +30,7 @@ export const markdownTags: {[type in MarkdownType]: MarkdownTag} = { entityName: 'messageEntityItalic' }, monospace: { - match: '[style*="monospace"], [face="monospace"]', + match: '[style*="monospace"], [face="monospace"], pre', entityName: 'messageEntityPre' }, strikethrough: { diff --git a/src/scss/partials/_chat.scss b/src/scss/partials/_chat.scss index 263ef25f..9f61dbcf 100644 --- a/src/scss/partials/_chat.scss +++ b/src/scss/partials/_chat.scss @@ -130,6 +130,11 @@ $chat-helper-size: 36px; white-space: pre-wrap; font-size: var(--messages-text-size); line-height: var(--line-height); + + pre { + display: inline; + margin: 0; + } @include animation-level(2) { transition: height .1s;