Fix SVGs containing <title> not rendering in markdown-svg-renderer#286
Conversation
DOMPurify's SAFE_FOR_XML protection (default on in 3.x) strips any attribute whose value contains raw-text element closers like </title>, </style> or </script>. The sanitized SVG was stored in a data-svg attribute and then run through the second document-level DOMPurify pass, so any SVG containing one of those elements lost its data-svg attribute and was silently skipped by hydrateSvgBlocks, leaving a blank gap in the preview. Store sanitized SVG sources in a JS Map keyed by id instead, and emit only a data-svg-id reference through the markdown sanitization pass, so DOMPurify never inspects the SVG markup as an attribute value. https://claude.ai/code/session_01HTbzMyrEPHhHqGiFttbbqA
|
Claude finished @simonw's task —— View job Code Review for SVG Rendering FixReviewing the changes to fix SVGs containing Todo List:
AnalysisThe fix addresses a subtle but critical issue with DOMPurify's SAFE_FOR_XML protection. The problem occurred when SVG content contained elements like Code Quality & Implementation ✅Excellent solution design:
Implementation quality:
Potential Bugs & Issues ✅No significant issues found:
Minor considerations:
Performance Considerations ✅Positive impact:
No performance concerns:
Security Assessment ✅Security remains intact:
Improvement over previous approach:
Test Coverage Recommendations
|
|
Fixed: https://claude-eloquent-tesla-l30aaz.tools-b1q.pages.dev/markdown-svg-renderer#url=https%3A%2F%2Fgist.github.com%2Fsimonw%2F94fde31c34a0400c1d29f57e6a708e6b (last pelican has |
Fix by Fable 5, bug identified by GPT-5.5.
Fable 5 in Claude Code says:
https://claude.ai/code/session_01HTbzMyrEPHhHqGiFttbbqA