Skip to content

Conversation

@gabrielcld2
Copy link
Collaborator

@gabrielcld2 gabrielcld2 commented Oct 9, 2025

Inline SVG data can cause some issues to our parsing if they're too long.
Given we're not interested in these, it's simpler to strip them out prior to our parsing.

Fixes #1092

Approach

  • The current parsing fails when encountering large inline SVG files within the page content
  • By filtering these out prior to the parsing, we ensures the parsing won't have issues, and we don't risk breaking the existing parsing functionality.

QA notes

  • Install and activate this test plugin which adds some large inline SVGs to the content:
    inline-svg-test.zip
    • the original issue was related to the Jet Engine plugin. This can work too to reproduce it, but I've noticed that it doesn't always occur. the test plugin above reproduces the bug every time by generating even larger inline SVGs.
  • Go to Cloudinary General Settings
    • Set storage to Cloudinary Only
    • Save Changes
  • Go to Media library
    • You might need to wait a minute for the local assets to be removed
    • Click on "edit" for an existing image
    • Without the patch, the image preview doesn't show, while once patched the image is displayed.

Inline SVG data can cause some issues to our parsing if they're too long. Given we're not interested in these, it's simpler to strip them out prior to our parsing
Copy link
Collaborator

@aatanasov-cloudinary aatanasov-cloudinary left a comment

Choose a reason for hiding this comment

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

Thanks @gabrielcld2, great job, works as expected. 🚀

@aatanasov-cloudinary aatanasov-cloudinary merged commit e392d29 into develop Oct 9, 2025
5 checks passed
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.

3 participants