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

Page Builder - Use object HTML Tag When Rendering SVGs #4041

Merged
merged 2 commits into from Mar 14, 2024

Conversation

adrians5j
Copy link
Member

@adrians5j adrians5j commented Mar 13, 2024

Changes

With this PR, we're allowing users to use the object HTML tag when rendering SVGs with the Image page element.

The following screenshot shows two images, one rendered the usual way, one rendered with the new object HTML tag:

image

Note that, for existing users / backwards compatibility, existing SVG images on pages will still be rendered via the img HTML tag. But, if needed, users are able to change this via the new HTML Tag input:

image

Also note that, once a user upgrades their Webiny project, all newly selected images will have their HTML tag set to "Auto-detect". In other words, if a user selects a file that ends up with the .svg extension, object HTML tag will be used. Otherwise, img HTML tag will be used.

How Has This Been Tested?

Manually.

Documentation

Changelog.

@adrians5j adrians5j added this to the 5.39.4 milestone Mar 13, 2024
@adrians5j adrians5j requested a review from Pavel910 March 13, 2024 14:36
Copy link
Collaborator

@Pavel910 Pavel910 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement! Let's go with this for the time being, and in the future we'll do some housekeeping on that image renderer, as it's becoming increasingly difficult to follow the logic, too many if statements and reassignments.

@adrians5j adrians5j merged commit 56d175e into dev Mar 14, 2024
5 checks passed
@Pavel910 Pavel910 modified the milestones: 5.39.4, 5.40.0 Mar 26, 2024
@adrians5j
Copy link
Member Author

/cypress

@adrians5j adrians5j deleted the adrian/pb-svg-support branch April 5, 2024 07:40
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

Successfully merging this pull request may close these issues.

None yet

2 participants