Skip to content

Multi-cell hyperlink with Markdown followed by \n #916

@mariostg

Description

@mariostg

Regarding this example : https://py-pdf.github.io/fpdf2/Links.html#hyperlink-with-fpdfmulti_cell

If I use a \n after website like so:

from fpdf import FPDF

pdf = FPDF()
pdf.set_font("helvetica", size=24)
pdf.add_page()
pdf.multi_cell(
    pdf.epw,
    txt="**Website:**\n[fpdf2](https://py-pdf.github.io/fpdf2/) __Go visit it!__",
    markdown=True,
)
pdf.output("hyperlink.pdf")

txt is rendered as expected, but the following does not work as expected; the link is not rendered and the new line neither. See \n just after the link

from fpdf import FPDF

pdf = FPDF()
pdf.set_font("helvetica", size=24)
pdf.add_page()
pdf.multi_cell(
    pdf.epw,
    txt="**Website:** [fpdf2](https://py-pdf.github.io/fpdf2/)\n__Go visit it!__",
    markdown=True,
)
pdf.output("hyperlink.pdf")

Environment
Mac OSX
Python version: 3.11.1
fpdf2 2.7.5

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions