Skip to content

Fix SVG export to use selectable text elements instead of rasterized images#871

Open
SKaranjaN wants to merge 1 commit intodrawdb-io:mainfrom
SKaranjaN:fix/svg-export-selectable-text
Open

Fix SVG export to use selectable text elements instead of rasterized images#871
SKaranjaN wants to merge 1 commit intodrawdb-io:mainfrom
SKaranjaN:fix/svg-export-selectable-text

Conversation

@SKaranjaN
Copy link

Fixes #839

The current SVG export uses html-to-image's oSvg function which rasterizes text content inside oreignObject elements, making it unselectable in browsers.

This PR replaces the export implementation with a custom solution that:

  • Converts all oreignObject elements to native SVG elements with nodes
  • Preserves text styling (colors, fonts, positioning)
  • Handles tables, notes, and areas correctly
  • Makes all text selectable and copyable in exported SVG files

The exported SVG files now contain true SVG text elements that can be selected in any browser.

…images

Replaced html-to-image's toSvg function with a custom implementation that converts foreignObject elements to native SVG text elements. This makes all text in exported SVG files selectable and copyable in browsers.

Fixes drawdb-io#839
@vercel
Copy link

vercel bot commented Feb 12, 2026

@SKaranjaN is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Exporting SVG is not a true svg

1 participant