Skip to content

Generating <image /> elements inside an <svg> ends up with <img /> outside #1063

@n-gt

Description

@n-gt

Astro Info

Astro                    v5.1.8
Node                     v20.15.1
System                   Linux (x64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             astro-icon
                         @astrojs/tailwind
                         @astrojs/alpinejs

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When I try to add elements to an SVG programmatically within an <svg></svg>, the resulting html ends up with <img> tags outside of it.

What's the expected result?

<svg>
  <image 1.. />
  <image 2.. />
  ....
</svg>

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-hx1emndl?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions