From fb14ea88a647153c5b9f4886e0fc9a7053dd2a88 Mon Sep 17 00:00:00 2001 From: Vladimir 'join3r' Schmotzer Date: Thu, 1 Oct 2026 12:18:44 +0200 Subject: [PATCH] fix(notebooks): follow-ups to rich outputs (#5) - An IPython display object's text/plain placeholder ("") no longer hides its HTML, markdown or JSON; real plain text still wins, as before. - Kernel HTML is sanitized without
cover
' } + }] + const { container } = render() + expect(container.querySelector('style')).toBeNull() + expect(container.querySelector('[style]')).toBeNull() + expect(container.textContent).toContain('cover') + }) }) describe('markdown attachments', () => { @@ -88,6 +107,14 @@ describe('markdown attachments', () => { expect(resolveMarkdownAttachments('![a](attachment:x.png)', undefined)).toBe('![a](attachment:x.png)') }) + it('leaves attachment: references inside code alone', () => { + const source = 'see `attachment:checker.png`\n\n```\n![x](attachment:checker.png)\n```\n\n![y](attachment:checker.png)' + const out = resolveMarkdownAttachments(source, attachments) + expect(out).toContain('`attachment:checker.png`') + expect(out).toContain('```\n![x](attachment:checker.png)\n```') + expect(out).toContain(`![y](data:image/png;base64,${PNG})`) + }) + it('handles URL-encoded names', () => { const named = { 'my image.png': { 'image/png': PNG } } expect(resolveMarkdownAttachments('![a](attachment:my%20image.png)', named)).toContain('data:image/png;base64,')