diff --git a/src/renderer/components/NotebookCell.tsx b/src/renderer/components/NotebookCell.tsx
index f5e6ee0e..52eac66a 100644
--- a/src/renderer/components/NotebookCell.tsx
+++ b/src/renderer/components/NotebookCell.tsx
@@ -477,7 +477,7 @@ export default function NotebookCellView({
)
)}
- {cell.cellType === 'code' && }
+ {cell.cellType === 'code' && }
)
}
diff --git a/src/renderer/components/NotebookOutputs.tsx b/src/renderer/components/NotebookOutputs.tsx
index fc535d51..0b21437c 100644
--- a/src/renderer/components/NotebookOutputs.tsx
+++ b/src/renderer/components/NotebookOutputs.tsx
@@ -22,7 +22,17 @@ function TruncationNote(): React.ReactElement {
)
}
-function OutputBlock({ output }: { output: NotebookOutput }): React.ReactElement | null {
+// Kernel HTML is sanitized (no scripts, no event handlers) and may not carry CSS:
+// a
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('', undefined)).toBe('')
})
+ it('leaves attachment: references inside code alone', () => {
+ const source = 'see `attachment:checker.png`\n\n```\n\n```\n\n'
+ const out = resolveMarkdownAttachments(source, attachments)
+ expect(out).toContain('`attachment:checker.png`')
+ expect(out).toContain('```\n\n```')
+ expect(out).toContain(``)
+ })
+
it('handles URL-encoded names', () => {
const named = { 'my image.png': { 'image/png': PNG } }
expect(resolveMarkdownAttachments('', named)).toContain('data:image/png;base64,')