-
Notifications
You must be signed in to change notification settings - Fork 5
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
Too large images result in blank page #307
Comments
experienced the same issue and started debugging it. It comes from https://github.com/michelf/php-markdown/blob/51613168d71787b0fe8472166ccbfa8d285c02cd/Michelf/MarkdownExtra.php#L1065-L1071 which returns null. so there must be some error occurring in that preg_replace.. remaining call stack:
but that's all I know so far, ran out of time |
Worth reporting an upstream issue in https://github.com/michelf/php-markdown ? This kind of regex work usually requires some optimization :) |
increasing https://www.php.net/manual/en/pcre.configuration.php#ini.pcre.backtrack-limit would be a workaround apparently |
yeah I can do that. |
The regex that is causing issues is
and further up at https://github.com/michelf/php-markdown?tab=readme-ov-file#requirement
I can still try to report it, but could be that the answer is to increase that limit. Anyway, the report: michelf/php-markdown#399 I can try to find out how much bigger it needs to be to support e.g. ~512K images at least. In case you're willing to increase the limit as a workaround. |
We can raise the limit in the docker image, meanwhile |
Given an image that has a byte size over a certain amount the page renders as a blank string. You can see a demonstration of this in the
fix-large-inline-image
branch.A couple things to note:
MarkdownToHml
formatter. Before the Markdown parsing the$page->content()
contains the proper image and after parsing the$page->content()
is a blank string.The text was updated successfully, but these errors were encountered: