formatting

This commit is contained in:
7w1 committed 2026-05-14 23:48:10 -05:00
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>&#60;<a href="https://example.org/">https://example.org/</a>&#62;</p>';
const html = '<p>&#60;<a href="https://example.org/">https://example.org/</a>&#62;</p>';
expect(htmlToMarkdown(html)).toBe('[https://example.org/](<https://example.org/>)');
});