fix(quotes): resolve external quote links across boards (#1064)

This commit is contained in:
Tommaso Casaburi
2026-03-12 17:41:11 +08:00
committed by GitHub
parent ef375e3578
commit fe55e6f332
58 changed files with 1719 additions and 92 deletions
@@ -128,6 +128,10 @@ vi.mock('../../reply-quote-preview', () => ({
),
}));
vi.mock('../external-number-quote-link', () => ({
default: ({ reference }: { reference: { raw: string } }) => createElement('a', { 'data-testid': 'external-number-quote-link', href: '#' }, reference.raw),
}));
let container: HTMLDivElement;
let root: Root;
@@ -204,6 +208,16 @@ describe('Markdown', () => {
expect(quotePreview?.textContent).toBe('comment-42');
});
it('renders lazy same-board and cross-board number quotes when the cid is not cached', async () => {
await renderMarkdown({
content: '>>42 >>>/fit/77',
subplebbitAddress: 'music-posting.eth',
});
const lazyLinks = Array.from(container.querySelectorAll('[data-testid="external-number-quote-link"]'));
expect(lazyLinks.map((node) => node.textContent)).toEqual(['>>42', '>>>/fit/77']);
});
it('toggles inline media embeds for embeddable links outside catalog view', async () => {
testState.mediaInfoByHref = {
'https://cdn.example/image.png': {