release: v0.15.0 (#585)

Eighteen changes since v0.14.0. See CHANGELOG.md for the full list and the upgrade notes (bump IMAGE_CACHE_VERSION).
This commit is contained in:
Ralksta
2026-09-19 22:24:10 +02:00
committed by GitHub
parent e99d3f2f1b
commit c3f92ca4ec
74 changed files with 4791 additions and 2146 deletions

View File

@@ -142,4 +142,45 @@ A closing paragraph with **bold** details.`;
expect(markdown).toContain('![photo-1:fullbleed](Caption)');
expect(markdown).toContain('![p1, p2](Pair caption)');
});
it('keeps a markdown link in the quote attribution for rendering (#559)', () => {
const markdown = '> Silence was absolute. -- [BBC Archive](https://example.com/archive)';
const parsed = parseEssayMarkdown(markdown);
const quote = parsed.blocks[0];
expect(quote.type).toBe('quote');
if (quote.type !== 'quote') return;
// The attribution stays Markdown; EssayView renders it with
// renderInlineMarkdown, which is what turns the link into an anchor.
expect(quote.author).toBe('[BBC Archive](https://example.com/archive)');
expect(renderInlineMarkdown(quote.author!)).toContain(
'<a href="https://example.com/archive" target="_blank" rel="noopener noreferrer">BBC Archive</a>',
);
});
it('survives a serialize/parse round-trip without losing the attribution link', () => {
const markdown = '> Silence was absolute. -- [BBC Archive](https://example.com/archive)';
const once = serializeEssayMarkdown(parseEssayMarkdown(markdown));
expect(once).toContain('> Silence was absolute. -- [BBC Archive](https://example.com/archive)');
const reparsed = parseEssayMarkdown(once);
const quote = reparsed.blocks[0];
expect(quote.type).toBe('quote');
if (quote.type === 'quote') {
expect(quote.author).toBe('[BBC Archive](https://example.com/archive)');
}
});
it('does not turn an unsafe scheme in the attribution into a link', () => {
const markdown = '> Careful. -- [x](javascript:alert(1))';
const parsed = parseEssayMarkdown(markdown);
const quote = parsed.blocks[0];
expect(quote.type).toBe('quote');
if (quote.type !== 'quote') return;
const html = renderInlineMarkdown(quote.author!);
expect(html).not.toContain('<a');
expect(html).not.toContain('href');
});
});