We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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:
fpdf2
The text was updated successfully, but these errors were encountered:
Thanks for reporting this, and welcome to fpdf2, @exiva !
Well, the documentation doesn't promise that our markup parser would honor backslash escapes, so technically this isn't a bug... 😉
it is a perfectly valid feature request, though! Any chance you might want to submit a PR?
Sorry, something went wrong.
If you want a head start, markdown markers are handled on fpdf _parse_chars() function.
_parse_chars()
fpdf2/fpdf/fpdf.py
Lines 3500 to 3515 in d574b07
No branches or pull requests
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:
Should output "This is a markdown test. Theres__double underscores" but outputs
![Screenshot 2024-06-25 at 10 04 24 AM](https://private-user-images.githubusercontent.com/56931/342760229-b143074d-28ec-4918-95c4-2aa3fa149f6b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5NzY4NzEsIm5iZiI6MTcxOTk3NjU3MSwicGF0aCI6Ii81NjkzMS8zNDI3NjAyMjktYjE0MzA3NGQtMjhlYy00OTE4LTk1YzQtMmFhM2ZhMTQ5ZjZiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAzVDAzMTYxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI5YTJjZmQ2NWEyMDRmN2Y1NDM2NzBkNDM0NTFlNGM5MzM4NzVkMWIzOGNhNGEyYzMxZGYzYTlkZmNkNDVkM2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.23trCn6AO2e67oLSzUmyjyGGY565k6QNk3YQCkgFZvs)
Environment
Please provide the following information:
fpdf2
version used: 2.7.9The text was updated successfully, but these errors were encountered: