-
Notifications
You must be signed in to change notification settings - Fork 259
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
Escape character escaping multiple consecutive markdown characters #1236
Comments
Thanks for reporting this, @JoseMezaMendieta , and welcome to fpdf2! The equivalence to the escape backslash in Python is obviously not identical, as in our case it is supposed to always escape exactly two characters at a time instead of one. But of course it should not escape any longer sequence than that. Pinging the implementer @david-fed to see if he has a good idea how to fix this. |
Or could we interest you in submitting a PR, @JoseMezaMendieta ? |
I'd be interested in taking a crack at it! It'd be my first contribution if I can figure it out. |
I just reported a similar problem in #1215 (comment) 😊 I did not see this issue from @JoseMezaMendieta beforehand (thank you for opening it 👍) I think we should conform to the CommonMark standard regarding character escaping rules. |
Error details
The documentation says that the escape character
\
behaves in the same way that it generally does for Python. To my understanding, in Python the escape character only applies to 1 single instance immediately after the escape character. However, the escape character seems to be escaping multiple instances of special characters immediately after it. In the following code example, I am trying to escape the first instance of double asterisks, then enable bold, print the word in bold, disable bold, then print double asterisks again. All this should be done with no spaces in between, however, the output is not what was expected.Minimal code
Please include some minimal Python code reproducing your issue:
Expected output:
Actual output:
Environment
Please provide the following information:
fpdf2
version used: fpdf2 @ git+https://github.com/py-pdf/fpdf2.git@e6a369d76e910dfb557478ef6e23d0b9d8392367The text was updated successfully, but these errors were encountered: