Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML <title> text is replaced by <title> in SVG content #459

Closed
alc opened this issue Apr 20, 2021 · 5 comments
Closed

HTML <title> text is replaced by <title> in SVG content #459

alc opened this issue Apr 20, 2021 · 5 comments
Milestone

Comments

@alc
Copy link

alc commented Apr 20, 2021

When htmx loads content that includes SVG content including a <title>, it updates the containing HTML document's <title>.

This was introduced in 0f72543, where it selects the first available title tag regardless of context.

My initial thought was to add hx-preserve to the HTML <title>, which doesn't seem to work, but it might be a reasonable fix.

@aloco
Copy link

aloco commented Aug 26, 2021

Hi,

I just stumbled over this issue when using sprig 1.8.0 (which uses htmx 1.5.0) and it seems like the document title is still replaced by the svg title

putyourlightson/craft-sprig#144

I am using https://craftcms.com/docs/3.x/dev/functions.html#svg within a sprig component

Please let me know if you need any other details

thank you !

@bencroker
Copy link
Sponsor Collaborator

@aloco Can you ensure that the <title> tag comes before the svg tag in your output? That is what was fixed in bdefbd4

@aloco
Copy link

aloco commented Aug 26, 2021

Since the sprig component is just a small partial of the whole site there is no document title in the output.

@bencroker
Copy link
Sponsor Collaborator

Ok I see, I think I misunderstood, am testing now.

@bencroker
Copy link
Sponsor Collaborator

I've created an issue specifically for this at #576.

strangeRabbit777 added a commit to strangeRabbit777/high-power-tool that referenced this issue Aug 23, 2022
strangeRabbit777 added a commit to strangeRabbit777/high-power-tool that referenced this issue Aug 25, 2022
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

No branches or pull requests

4 participants