Skip to content
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

HTML blockquotes are not indented #1074

Open
dmail00 opened this issue Dec 24, 2023 · 3 comments
Open

HTML blockquotes are not indented #1074

dmail00 opened this issue Dec 24, 2023 · 3 comments

Comments

@dmail00
Copy link

dmail00 commented Dec 24, 2023

Describe the bug
HTML blockquotes are not indented and as a consequence nested blockquotes are not indented.

Minimal code

from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.write_html("before<blockquote>level 1</blockquote>after")
pdf.write_html("before<blockquote>level 1<blockquote>level 2</blockquote></blockquote>after")
pdf.output("test_blockquotes.pdf")

Environment
Please provide the following information:

  • Operating System: Windows
  • Python version: 3.11.3
  • fpdf2 version used: 2.7.7
@dmail00 dmail00 added the bug label Dec 24, 2023
@Lucas-C Lucas-C added the html label Dec 30, 2023
@Lucas-C
Copy link
Member

Lucas-C commented Dec 30, 2023

Hi @dmail00

As the default HTML <blockquote> is usually rendered with a default margin-left: 40px,
we could indeed handle some left margin for thos elements.

Interestingly, the code the renders <bloquote> tags already as some kind of "indent" logic:
https://github.com/py-pdf/fpdf2/blob/2.7.7/fpdf/html.py#L500
But I don't think it ever worked...

@dmail00: would you like to contribute a PR to implement this?

@gmischler: do you think that this kind of indent should be handled by paragraphs / text regions?

@gmischler
Copy link
Collaborator

@gmischler: do you think that this kind of indent should be handled by paragraphs / text regions?

Yes, as in #1073, giving Paragraph()s an indent option would probably be the cleanest solution here.

@Lucas-C
Copy link
Member

Lucas-C commented Feb 27, 2024

A first implementation of this feature will be added by PR #1124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants