mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-21 09:31:17 -08:00
formatting
This commit is contained in:
1 parent
24a7a9d05c
commit
e19e0df8f9
2 files changed
+2
-4
No files matched your search
@@ -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;
|
||||
|
||||
@@ -68,8 +68,7 @@ describe('htmlToMarkdown', () => {
|
||||
});
|
||||
|
||||
it('converts hidden-preview wrapped links when angle brackets are decimal entities', () => {
|
||||
const html =
|
||||
'<p><<a href="https://example.org/">https://example.org/</a>></p>';
|
||||
const html = '<p><<a href="https://example.org/">https://example.org/</a>></p>';
|
||||
expect(htmlToMarkdown(html)).toBe('[https://example.org/](<https://example.org/>)');
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user