HTML tags in pdf
-
Hello,
I use HTML tags in my products titles like <b></b>, etc. While properly displayed in HTML (including emails), they aren’t shown correctly in the generated PDF invoices.
How can I fix it?
-
Hi @edvardukou,
Could you please provide more details about the issue, maybe showing in a screenshot what is not displaying correctly? You can use imgbb.com to upload the screenshot, and then share here the image URL.
BMW should be in bold or as simple array.
Sorry if I don’t understand, are you applying the HTML tags to the product name directly? If so, it should be displaying formatted correctly on the PDF invoice.
Yes, that’s correct. I found an old PDFs and products names are formatted correctly, but if I try to generate new invoices it’s not. Maybe there is something with the last updates?
You’re right, @edvardukou!
We have sanitized the HTML output in the last release, stripping all the HTML tags. I have updated this behavior in our development repository, using a different function that allow HTML formatting for product titles. Please install this beta release and let me know if the formatting works again: https://we.tl/t-EAeeJJOgiG
It’s worked! Thank you, @yordansoares !
Confirming the beta has corrected the same issue for my client’s site. Thank you
Yip. Beta fixed it for us 🙂
Can we expect a commit on the wp servers today?My customer is using my Mix and Match Products plugin which is wrapping certain product titles in a
<small>element. They report that “<small>” is still visible with the beta release. Can you whitelist that HTML tag? I haven’t checked your source butwp_kses_post()may be appropriate.-
This reply was modified 3 years, 7 months ago by
HelgaTheViking.
Looks like in 3.2.2 the item title is wrapped in
esc_html()which is probably responsible.
https://plugins.trac.ww.wp.xz.cn/browser/woocommerce-pdf-invoices-packing-slips/tags/3.2.2/templates/Simple/invoice.php#L112Hi @helgatheviking,
I left above a beta release that you can use to fix this issue, which was introduced in the latest version, after applying escaping and sanitization functions to make the code more secure.
We’re working on this to launch a fix as soon as possible. I’ll let you know when it’s published!
@yordansoares thanks for that. I saw the beta, and they reported it didn’t resolve the issue for them. I haven’t tested it myself yet… Technically this is outside my support policy but i noticed you already had this open thread so pointed them this way.
Hi @edvardukou, @andrewews, @davemspan, and @helgatheviking:
We have launched a new release just some minutes ago, please update and let us know if the issue is gone!
Hi @edvardukou. @andrewews. @davemspan. @helgatheviking:
Just to check your status… Were you able to solve your problem by updating the plugin to version(3.2.4)?
Let me know if it worked for you!
Yes thank you Jhonny
-
This reply was modified 3 years, 7 months ago by
The topic ‘HTML tags in pdf’ is closed to new replies.