lpaulsen93 / dokuwiki-plugin-odt

Exports a page to the Open Document format used by OpenOffice.org and other word processors
http://www.dokuwiki.org/plugin:odt
13 stars 26 forks source link

Fix exhibition of 0 values on cell table end #319

Closed eduardomozart closed 6 months ago

eduardomozart commented 6 months ago

The following table:

^B  ^A  ^S^
|0  |0  |0|

Was generating the following ODT output:

image

Notice that the last column ("S") contains no value. This occurs because PHP empty() function assumes that 0 (int or str) is empty, so it doesn't print out on screen. Here's the ODT output after applying this fix:

image
Klap-in commented 6 months ago

Useful fix. Still this looks a bit as a special way of checking for 0 values. DokuWiki has also the function blank(). Probably it is more readable if you use that blank() function, such that the function name tells directly what the intent is?

eduardomozart commented 6 months ago

Hello @Klap-in, I tested using the blank() function it seems to be working as expected. I replaced the code to use it with a @ to disable PHP warnings when display_errors directive is set and text is empty.