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 ignores attr:x-show #9948

Closed
robdekort opened this issue Apr 23, 2024 · 3 comments
Closed

[5.x] Svg tag ignores attr:x-show #9948

robdekort opened this issue Apr 23, 2024 · 3 comments
Labels

Comments

@robdekort
Copy link
Contributor

robdekort commented Apr 23, 2024

Bug description

When adding an attr:x-show or x-show attribute to the SVG tag, it seems to get removed. I'm not sure however if this is intended behaviour in v5?

How to reproduce

Use attr:x-show or x-show on an SVG tag in v5 alpha 5

Logs

No response

Environment

Environment
Application Name: connect2id
Laravel Version: 11.4.0
PHP Version: 8.2.16
Composer Version: 2.7.1
Environment: local
Debug Mode: ENABLED
URL: connect2id.test
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 6
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.0.0-alpha.5 PRO

Statamic Addons
rias/statamic-color-swatches: 2.2.0
studio1902/statamic-peak-browser-appearance: 3.4.0
studio1902/statamic-peak-commands: 8.2.0
studio1902/statamic-peak-seo: 8.11.0
studio1902/statamic-peak-tools: 6.0.0
trendyminds/statamic-palette: 1.0.4

Installation

Starter Kit using via CLI

Antlers Parser

None

Additional details

No response

@jasonvarga
Copy link
Member

I think it's probably the sanitizing because x-show isn't a valid attribute.

Can you try adding sanitize="false" or allow_attrs="x-show" just to see if it helps?

@robdekort
Copy link
Contributor Author

Oh yeah that does the trick. Handy to learn about allow_attrs. Should attributes prefixed with attr: get automatically allowed perhaps?

@jasonvarga
Copy link
Member

Should attributes prefixed with attr: get automatically allowed perhaps?

We can probably figure out any attributes you've added (attr: prefixed or not) and automatically allow them.

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

3 participants