diff --git a/src/app/features/room/message/hiddenLinkPreviews.ts b/src/app/features/room/message/hiddenLinkPreviews.ts index 1d0ca26c5..7c8ed7e54 100644 --- a/src/app/features/room/message/hiddenLinkPreviews.ts +++ b/src/app/features/room/message/hiddenLinkPreviews.ts @@ -28,8 +28,7 @@ export function stripMarkdownEscapesForHiddenPreviews(markdown: string): string s = s.replace(ESCAPED_SUPPRESSED_MD_LINK, '[$1]($2)'); // Same for "\<[label](bare-url)>" when angle brackets were lost on the destination. - const WRONG_OUTER_ESCAPED_AUTOLINK = - /\\<\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)(?:>|\\>)/g; + const WRONG_OUTER_ESCAPED_AUTOLINK = /\\<\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)(?:>|\\>)/g; s = s.replace(WRONG_OUTER_ESCAPED_AUTOLINK, '[$1](<$2>)'); return s; diff --git a/src/app/plugins/markdown/htmlToMarkdown.test.ts b/src/app/plugins/markdown/htmlToMarkdown.test.ts index 238fdbacb..8ca43b6ad 100644 --- a/src/app/plugins/markdown/htmlToMarkdown.test.ts +++ b/src/app/plugins/markdown/htmlToMarkdown.test.ts @@ -68,8 +68,7 @@ describe('htmlToMarkdown', () => { }); it('converts hidden-preview wrapped links when angle brackets are decimal entities', () => { - const html = - '
'; + const html = ''; expect(htmlToMarkdown(html)).toBe('[https://example.org/](