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

[5.x] SVG tag with duplicate attribute throws error #9909

Closed
jasonvarga opened this issue Apr 16, 2024 · 1 comment
Closed

[5.x] SVG tag with duplicate attribute throws error #9909

jasonvarga opened this issue Apr 16, 2024 · 1 comment
Labels

Comments

@jasonvarga
Copy link
Member

Bug description

If you have an svg that contains a class, for example, and then you add class="" to the tag, it will throw an error:

DOMDocument::loadXML(): Attribute class redefined in Entity, line: 1

This is only an issue now because svgs are sanitized by default.

Without sanitizing, technically both class attributes get output, but it seems that browsers discard the second one, which is what comes from the file. We should try to apply the same behavior: make the attribute from the tag win.

How to reproduce

<svg class="foo">...</svg>
{{ svg src="foo.svg" class="bar" }}

Logs

No response

Environment

5.0.0-alpha.3

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

None

Additional details

No response

@jasonvarga
Copy link
Member Author

Can't reproduce this error anymore. 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants