Skip to content

Commit 013f94f

Browse files
Shaun Mahonyclaude
andcommitted
Merge branch 'claude/inspiring-mccarthy': SVG Illustrator fix
Fix SVG export so embedded logos render in Adobe Illustrator by adding xmlns:xlink namespace and xlink:href attribute to <image> elements. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2 parents 4ac6390 + b93a9ee commit 013f94f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web/src/lib/export/logoRenderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ export function exportLogosAsSvg(
399399
const hasLabels = logos.some((l) => l.label);
400400
const compositeW = (hasLabels ? labelWidth : 0) + maxLogoW;
401401

402-
let svgContent = `<svg xmlns="http://www.w3.org/2000/svg" width="${compositeW}" height="${totalH}" viewBox="0 0 ${compositeW} ${totalH}">\n`;
402+
let svgContent = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${compositeW}" height="${totalH}" viewBox="0 0 ${compositeW} ${totalH}">\n`;
403403
svgContent += `<rect width="100%" height="100%" fill="white"/>\n`;
404404

405405
let y = 0;
@@ -414,7 +414,7 @@ export function exportLogosAsSvg(
414414

415415
const dataUrl = logoCanvas.toDataURL("image/png");
416416
const xOff = hasLabels ? labelWidth : 0;
417-
svgContent += `<image x="${xOff}" y="${y}" width="${lw}" height="${lh}" href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-s1">${dataUrl}"/>\n`;
417+
svgContent += `<image x="${xOff}" y="${y}" width="${lw}" height="${lh}" href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3Cspan+class%3D"pl-s1">${dataUrl}" xlink:href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%3Cspan+class%3D"pl-s1">${dataUrl}"/>\n`;
418418

419419
y += lh + gap;
420420
}

0 commit comments

Comments
 (0)