forked from reingart/pyfpdf
-
Notifications
You must be signed in to change notification settings - Fork 330
Open
Description
Error details
When using markdown in fpdf2 it should respect escaped characters like underscores and asterisks. It does not currently.
Minimal code
Please include some minimal Python code reproducing your issue:
from fpdf import FPDF
pdf = FPDF(format=(101.6, 152.4))
pdf.set_margin(2)
pdf.add_page()
pdf.set_font("Times", size=16)
txt = "**This** is a markdown test. Theres\__double underscores"
pdf.multi_cell(w=50, text=txt, align='L', new_x='RIGHT',
new_y='TOP', border=0, markdown=True,)
pdf.output("md.pdf")Should output "This is a markdown test. Theres__double underscores" but outputs

Environment
Please provide the following information:
- Operating System: macOS 14.5 Apple Silicon M2 Mac Mini
- Python version: 3.11.9
fpdf2version used: 2.7.9