GNOME Bugzilla – Bug 616607
Not all characters in HTML are correctly encoded.
Last modified: 2018-06-29 22:38:18 UTC
I have a transaction, which description is "J&J BABY WIPE TRAVEL PACK 20S". and in the html report, it is <td>J&J BABY WIPE TRAVEL PACK 20S</td> '&' should be encoded as '&' Could you double check the encode code against HTML standard to make sure every special characters are encoded?
Created attachment 189800 [details] [review] This patch fixes this issue (for non-eguile reports) This one was a PITA to track down and fix, but fixed it is. See the attached patch.
...scratch that, it looks like it needs a little tweaking. I should have a new patch shortly.
Created attachment 189802 [details] [review] Patch version 2 Okay, here is a better patch. The first patch would miss '&' if they occurred at the end of a line of body text, or in a few other corner cases. The second version of the patch should convert all cases of "&", "<" and ">" in body text. NOTE: This patch _ONLY_ fixes this defect in text within the body. If the report title contains an '&' (such as the "Profit & Loss" report) then this defect will still occur within the "<title>SOME & TEXT</title>" text, but that is a far less straightforward fix due to issues with the multicolumn reports, so it must be addressed separately. Thanks, -Tim
FML. !!!DO NOT USE ABOVE PATCHES!!! Apparently the multicolumn report problems are not related to the <title> issue and occur with the posted patch version 2 as well. The above patches will break multicolumn reports, so please do not apply them. This issue apparently will require major overhauls to the reporting structure to fix due to severe multicolumn report conflicts with this patch. I am not certain that this defect can be reasonably fixed within the existing reporting backend and may need to be deferred until the reporting backend is overhauled. -Tim
Review of attachment 189802 [details] [review]: See previous comment. This patch breaks multicolumn reports because the entire individual reports including html tags appear to be embedded within the multicolumn report as an html body text object which causes all html entities within the individual reports to be escaped by this patch.
I tried to reproduce this behaviour but did not succeed - GnuCash 2.6.14 I did not try multicolumn reports. To me it looks like the problem is gone.
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=616607. Please continue processing the bug there and please update any external references or bookmarks.