-
Notifications
You must be signed in to change notification settings - Fork 227
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
Fixed FPDF.local_context() style leak during page breaks - Fix #1204 #1207
Conversation
This PR also includes a fix (in
|
71f366f
to
5239fea
Compare
If you want to review this @gmischler & @andersonhc, I'll be happy to have your feedbacks 🙂 Else I'll merge this next week. |
I also used this opportunity to now render HTML in This change introduces a slight overhead of an extra I used this command to visually compare that all the reference files are still visually identical:
|
9752952
to
796ab2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tricky business, but it seems to work!
Thank you for the review @gmischler 👍 🙂 By the way, the code in
Those last two points in particular makes debugging quite painful... I tried to simplify some minor things in this PR, but we should try to improve things in this class whenever possible. |
Unfortunately I didn't look at your #1207 carefully enough, and didn't see that you put the local context handling on its head from how it worked before. I don't currently have time to study this in more detail. As a general guideline: The HTML module is not allowed to write anything into the output stream itself. It delegates that to the text region and table modules. Nonetheless it must change the font settings in |
This is a bit vague, what do you mean exactly by "on its head" and "more things" ? 🙂
OK, agreed. |
I had implemented the graphics stack handling within the module. It was necessary to drop down to the external stack level for the rendering calls. I think that was so that You just wrapped everything in a local context (which is probably fine), without lowering the stack level for rendering (which is probably suboptimal). |
Checklist:
The GitHub pipeline is OK (green), meaning that both
pylint
(static code analyzer) andblack
(code formatter) are happy with the changes of this PR.A unit test is covering the code added / modified by this PR
This PR is ready to be merged
[NA] In case of a new feature, docstrings have been added, with also some documentation in the
docs/
folderA mention of the change is present in
CHANGELOG.md
By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.