Skip to content

Blazor - Title attribute in SVG is picked up by HeadOutlet #44231

@mrlife

Description

@mrlife

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

SVG's <title> is reflected in the page's title

Expected Behavior

Only <title> in <head> should be used for page's title.

refs: #37019 and #37009

Steps To Reproduce

  1. Create a new Blazor Server app with .NET 6
  2. Comment out the <PageTitle> tags in MainLayout.razor and Index.razor
  3. Add the following to the end of index.razor
<svg viewBox="0 0 20 10" xmlns="http://www.w3.org/2000/svg">
    <circle cx="5" cy="5" r="4">
        <title>I'm a circle</title>
    </circle>
</svg>
  1. Run the project and note the title in the browser tab is "I'm a circle"

Here is a repro project: https://github.com/mrlife/HeadTitleTestNet6

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.feature-svg

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions