Skip to content

Commit 03a6987

Browse files
authored
Revert "Chat - Formatting is incorrect when pasting code into the compose box"
1 parent 1726e66 commit 03a6987

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/pages/home/report/comment/TextCommentFragment.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ function TextCommentFragment({fragment, styleAsDeleted, reportActionID, styleAsM
7373
const containsEmojis = CONST.REGEX.ALL_EMOJIS.test(text ?? '');
7474
if (!shouldRenderAsText(html, text ?? '') && !(containsOnlyEmojis && styleAsDeleted)) {
7575
const editedTag = fragment?.isEdited ? `<edited ${styleAsDeleted ? 'deleted' : ''}></edited>` : '';
76-
// We don't want to replace the space in tags with &nbsp;
77-
const escapedHtml = html.replace(/(?:(?![\n\r])\s)(?![^<]*>)/g, '&nbsp;');
78-
const htmlWithDeletedTag = styleAsDeleted ? `<del>${escapedHtml}</del>` : escapedHtml;
76+
const htmlWithDeletedTag = styleAsDeleted ? `<del>${html}</del>` : html;
7977

8078
let htmlContent = htmlWithDeletedTag;
8179
if (containsOnlyEmojis) {

0 commit comments

Comments
 (0)