Skip to content

Support SVG <use> references #27

@rowland

Description

@rowland

Problem

Some SVGs still warn with svg: <use>: unsupported element skipped. Those files rely on symbol/shape reuse via <use>, so skipping the element drops visible content.

What implementation would require

  • Parse and retain reusable elements under <defs> by id.
  • Resolve <use href="..."> and legacy xlink:href references.
  • Clone the referenced node subtree while applying the <use> element's own x, y, transform, and style overrides.
  • Make sure inherited style, clip-path, and transforms compose correctly with the referenced content.
  • Decide whether unresolved references should warn and skip or hard-fail.
  • Add tests for simple shape reuse, nested groups, and style overrides.

Workarounds

  • Expand <use> references before handing the SVG to leadtype. Many vector tools can outline or expand symbols during export.
  • Save a PDF-targeted SVG variant with duplicated geometry instead of symbol references.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions