Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.45k stars 2.79k forks source link

additional spaces in innertext after <br /> in odf.php #25841

Closed tronx2100 closed 1 month ago

tronx2100 commented 1 year ago

Bug

After
inodt pdf generation we have a leading space because <br > instead of
tag so we need to ltrim the text to fix it . the next line will then not start with a space

change in odf.php in line 369 ff.

                array_push($tags, array(
                    'text' => substr($tempHtml, 0, $tagOffset)
                ));

to

                array_push($tags, array(
                    'text' => ltrim(substr($tempHtml, 0, $tagOffset)) 
                ));

will fix this bug

Environment Version

18.0.1

Environment OS

linux debian bookworm

Environment Web server

nginx

Environment PHP

8.2.7

Environment Database

mariadb

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

No response

Attached files

No response

lucky4ever2 commented 1 year ago

I have exactly the same problem. Thank you for the provided solution. It works for me as well. Hopefully, the developers will incorporate this into the code.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required).