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

The default underlines of link (<a>) tags continue past the link into the remainder of the sentence. #1311

Closed
DerekRobin opened this issue Nov 28, 2024 · 4 comments

Comments

@DerekRobin
Copy link

When creating a link using an <a></a> tag and pdf.write_html(), the underline which normally appears on links continues past the link and throughout the remainder of the sentence.

Error details
No exceptions are raised

Minimal code

from fpdf import FPDF
pdf = FPDF()
pdf.add_page()
pdf.write_html(
    """
    The default <a href="https://www.google.com/" target="_blank">link underline</a> continues past the end of the link.
    """
)
pdf.write_html(
    """
    <a href="https://www.google.com/" target="_blank">It also occurs</a> when the link starts the sentence.
    """
)
pdf.output("link.pdf")

Screenshot of output PDF
link.pdf

Environment
Please provide the following information:

@K-Hern
Copy link

K-Hern commented Dec 3, 2024

Hello! I am looking into this. Could I be assigned?

@Lucas-C
Copy link
Member

Lucas-C commented Dec 4, 2024

Sure, @andersonhc assigned you this issue 🙂

If you have any question, go on and ask!

A good starting point can be: https://py-pdf.github.io/fpdf2/Development.html

@K-Hern
Copy link

K-Hern commented Dec 4, 2024

Thank you for the guidance! I believe I have found and fixed the issue! I have submitted a PR.

@Lucas-C
Copy link
Member

Lucas-C commented Dec 28, 2024

I have just merged PR #1316 that fixed this issue.

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