Bug 66822 - refactor HTML export of image bullet list
Summary: refactor HTML export of image bullet list
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
(earliest affected)
Hardware: Other All
: medium normal
Assignee: Susobhan Ghosh
Whiteboard: target:5.2.0
Keywords: difficultyBeginner, easyHack, skillCpp
: 86973 (view as bug list)
Depends on:
Reported: 2013-07-11 13:16 UTC by Andras Timar
Modified: 2016-10-25 19:07 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

This is a patch for the current bug. #66822 submitted by Tejas Nikumbh (454 bytes, text/plain)
2014-01-21 21:02 UTC, Tejas Nikumbh
Testcase? (10.05 KB, application/vnd.oasis.opendocument.text)
2014-11-25 02:49 UTC, Renato Ferreira
Testcase Output (2.96 KB, text/html)
2016-01-05 20:35 UTC, Susobhan Ghosh

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Timar 2013-07-11 13:16:48 UTC
For image bullet list HTML export is the following:
<UL SRC="{image data}" WIDTH={x} HEIGHT={y} ALIGN={something}>
	<P STYLE="margin-bottom: 0cm"><IMG SRC="{image data}" WIDTH={x} HEIGHT={y} ALIGN={something}>List item 1
	<P STYLE="margin-bottom: 0cm"><IMG SRC="{image data}" WIDTH={x} HEIGHT={y} ALIGN={something}>List item 2

Problem 1: in HTML standard <UL> tag does not have SRC attribute
Problem 2: <LI> tags are not used

CSS should be used here:

<UL STYLE="list-style-image: url({image data});">
<LI>List item 1
<LI>List item 2

See OutHTML_BulletImage function and its callers in sw/source/filter/html.
Comment 1 Björn Michaelsen 2013-10-04 18:46:23 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 2 Tejas Nikumbh 2014-01-21 21:02:18 UTC
Created attachment 92542 [details]
This is a patch for the current bug. #66822 submitted by Tejas Nikumbh

This is one of my first patches for an easy programming hack enlisted on the LibreOffice Gsoc page. My name is Tejas Nikumbh and I'm a senior undergrad at IIT Bombay.
Comment 3 darshana 2014-03-13 14:29:36 UTC
Is this issue fixed? If not can I submit a patch for the same?
Comment 4 Tejas Nikumbh 2014-03-13 14:33:04 UTC
I've submitted a patch. Dunno if its accepted or not.

On Thu, Mar 13, 2014 at 10:29 AM, <bugzilla-daemon@freedesktop.org> wrote:

>   *Comment # 3 <https://bugs.freedesktop.org/show_bug.cgi?id=66822#c3> on
> bug 66822 <https://bugs.freedesktop.org/show_bug.cgi?id=66822> from
> darshana <darshanapadmadas@gmail.com> *
> Is this issue fixed? If not can I submit a patch for the same?
>  ------------------------------
> You are receiving this mail because:
>    - You are the assignee for the bug.
Comment 5 How can I remove my account? 2014-03-13 14:34:26 UTC
Tejas: That is not a patch. And it certainly is not difficult enough to make you eligible for GSoC. And surely you should be able to check in git whether the change you intended to submit has gone in or not?

darshana: Surely if you intend to be able to submit a patch you should be able to first check if it is already fixed or not, or if Tejas's hack works or not.
Comment 6 Renato Ferreira 2014-11-25 02:49:29 UTC
Created attachment 109974 [details]

I have tried to replicate this on Mac OS X, LibreOffice Version:

I don't know if I'm doing something wrong, but for me the HTML export has no image at all for the bullets; not only was I unable to replicate the bug, but also encountered another one?

I'm attaching a test case, which is really just a document with a bulleted list where the bullets were formatted to one of the offered images.

If I choose regular bullets, the following HTML excerpt is generated:

<ul><li><p class="P2" style="margin-left:0cm;"><span class="Bullet_20_Symbols" style="display:block;float:left;min-width:0.635cm;">•</span>HeyMan<span class="odfLiEnd"/> </p></li><li><p class="P1" style="margin-left:0cm;"><span class="Bullet_20_Symbols" style="display:block;float:left;min-width:0.635cm;">•</span><span class="T1">LookAtMeRockingOut</span><span class="odfLiEnd"/> </p></li></ul>

Whereas the image one exports as:

<ul><li><p class="P2" style="margin-left:0cm;"><span style="display:block;float:left;min-width:0.635cm;"><!-- --></span>HeyMan<span class="odfLiEnd"/> </p></li><li><p class="P1" style="margin-left:0cm;"><span style="display:block;float:left;min-width:0.635cm;"><!-- --></span><span class="T1">LookAtMeRockingOut</span><span class="odfLiEnd"/> </p></li></ul>

This one does not have the Bullet_20_Symbols class or the hard-coded bullet, but neither does it have any style for the images as reported here.

Can anyone replicate this behaviour in the current development build? Is this another bug, or did I run a wrong test...?
Comment 7 Robinson Tryon (qubit) 2015-12-13 10:58:05 UTC Comment hidden (obsolete)
Comment 8 Susobhan Ghosh 2016-01-05 20:35:35 UTC
Created attachment 121740 [details]
Testcase Output
Comment 9 Susobhan Ghosh 2016-01-05 20:37:02 UTC
Hi! I'm just starting off. If this issue is not resolved, I'd like to take it up. I checked the test file and created a HTML file from it, and previewed in web browser too. I saw that the ul tag is not properly defined (not syntactically correct). I've attached the output I got.

Upon correcting the extra ul> at the end (refer attachment), the issue wasn't resolved. I replaced the svg data with some other svg data from the internet and the bullet image appeared properly. So if I'm not wrong, isn't there also some problem with the SVG base64 encoding / exporting of the SVG base64 data?
Comment 10 Buovjaga 2016-01-05 21:22:13 UTC
*** Bug 86973 has been marked as a duplicate of this bug. ***
Comment 11 Susobhan Ghosh 2016-01-06 17:19:00 UTC
I've managed to remove the improper syntax ( extra "<ul" at during <ul> tag usage ). But the base64 encoding for the SVG image is wrong. After decoding the base64 encoding into XML, there is 8 bits of garbage at the front, and a missing closing </svg> tag.

I've traced the whole conversion till here - http://opengrok.libreoffice.org/xref/core/svx/source/xoutdev/_xoutbmp.cxx#331

Any help regarding this would be helpful. In the meantime, should I commit with the ul tag fix?
Comment 12 Commit Notification 2016-01-11 16:40:36 UTC
susobhang70 committed a patch related to this issue.
It has been pushed to "master":


tdf#66822 - refactor HTML export of image bullet list

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.
Comment 13 Robinson Tryon (qubit) 2016-02-18 16:37:08 UTC Comment hidden (obsolete)