Skip to content

Conversation

@ags
Copy link
Member

@ags ags commented Sep 2, 2025

This removes base64 encoded src values from img tags, which are not widely supported by markdown renderers, are are causing parser performance issues and crashes.

@ags ags marked this pull request as ready for review September 2, 2025 04:37
This removes base64 encoded `src` values from `img` tags, which are not
widely supported by markdown renderers, are are causing parser
performance issues and crashes.
@ags ags force-pushed the 20305-ignore-base64-encoded-data-urls branch from 5043de8 to fe1050d Compare September 2, 2025 04:37
Copy link

@TJC TJC left a comment

Choose a reason for hiding this comment

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

Would it be worth emitting a deprecation warning when base64-encoded data URLs are encountered?

@ags
Copy link
Member Author

ags commented Sep 2, 2025

Not really a deprecation if they're removed entirely already; we could have done that in an earlier 1.x release, but since this is a 2.x breaking change I don't think it's a problem

@mattptc
Copy link

mattptc commented Sep 2, 2025

I ran

SELECT content_id
FROM drafts
WHERE document_json->>'body' LIKE '%base64%';

and didn't find any use of this in drafts. Are we seeing used anywhere?

@ags
Copy link
Member Author

ags commented Sep 2, 2025

and didn't find any use of this in drafts. Are we seeing used anywhere?

This gem is used in the draft editor for converting Word documents to Markdown, prior to the content being persisted. We've seen it happen a few times with one of the FR freelance editors copying from Word, but the conversion failed because of these image URLs and locked up the request worker while trying to parse it (we had a brief editorial-only incident the other day because they tried repeatedly and locked up many workers). I won't share it publicly, but there'll be a PR for the CMS to upgrade this gem where I'll include the Word doc from FR that triggered the problem

@ags ags merged commit dca9f4a into main Sep 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants