[frontend] Improve management of images when moving from HTML to PDF (#8207)#14715
[frontend] Improve management of images when moving from HTML to PDF (#8207)#14715
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14715 +/- ##
=======================================
Coverage 32.37% 32.37%
=======================================
Files 3098 3098
Lines 211019 211025 +6
Branches 38241 38243 +2
=======================================
+ Hits 68310 68313 +3
- Misses 142709 142712 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Consider adding a unit test to setImagesWidth so that your use cases are documented. (Or to htmlToPdf with a spy on htmlToPdfMake)
A better testing strategy for pdf generation like this would be too have an integration test but would be too large for this fix. Maybe we can do it when moving away from CKEditor to make sure we have no regression.
| let result = match; | ||
| result = result.replace(/ width="\d+"/, ''); | ||
| result = result.replace(/ height="\d+"/, ''); | ||
| return result.replace('<img ', `<img width="${widthInPixels}" `); |
There was a problem hiding this comment.
Aspect-ratio-changing edits, with specific height values, are not possible in CKEditor ?
|
I will add the asked tests in an other PR |
Proposed changes
Related issues
Checklist