Bug 108367 - XHTML Export: Some Images are missing after export
Summary: XHTML Export: Some Images are missing after export
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2017-06-06 15:27 UTC by mmaurer
Modified: 2021-05-18 13:27 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
The File to export (514.96 KB, application/vnd.oasis.opendocument.text)
2017-06-06 15:27 UTC, mmaurer
Details
The Result XHTML (402.79 KB, application/xhtml+xml)
2017-06-06 15:29 UTC, mmaurer
Details
Modified/Repaired File (514.98 KB, application/vnd.oasis.opendocument.text)
2017-11-13 09:28 UTC, Julian Jung
Details
Path for the xsl transformation from odf to xhtml (2.02 KB, patch)
2017-11-16 14:10 UTC, Julian Jung
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mmaurer 2017-06-06 15:27:41 UTC
Created attachment 133876 [details]
The File to export

Steps To Reproduce:

1. Open the attached ODT File
2. Export the file as XHTML.
3. Open the exported .xhtml file using Firefox.
-> the second image is missing
-> the text after the first image is missing

Browser used: Firefox/53.0
Comment 1 mmaurer 2017-06-06 15:29:02 UTC
Created attachment 133877 [details]
The Result XHTML
Comment 2 Jacques Guilleron 2017-06-07 15:18:44 UTC
Hi mmaurer,

I reproduce with
LO 5.5.0.0.alpha0+ Build ID: 0e6297932252403883a6057feee488e4ee2bc360
CPU threads: 2; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@39, Branch:master, Time: 2017-05-23_00:14:17
Locale: fr-FR (fr_FR); Calc: CL
Could you precise which OS you are using?

Thank you,

Jacques
Comment 3 mmaurer 2017-06-07 15:28:53 UTC
OS: Windows 7 Professional, service Pack 1
Comment 4 Jacques Guilleron 2017-06-07 15:54:38 UTC
Observed that saved in html, this file produce a correct file.
Comment 5 jjung 2017-07-24 07:42:19 UTC
The bug can be reproduced in the following version, too:

Version: 6.0.0.0.alpha0+ (x64)
Build ID: a9588baca8137f51e2ca72e40b1f448b0e1885d1
CPU threads: 8; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2017-07-21_04:09:11
Locale: de-DE (de_DE); Calc: CL

The created *.html file contains only one image and to little text.

I can confirm that the html created by "Preview in Web Browser" and by "Send -> Create HTML Document" is correct.
Comment 6 Julian Jung 2017-11-13 09:28:34 UTC
Created attachment 137708 [details]
Modified/Repaired File

I figured out that the usage of <text:line-break/> nodes (instead of "normal" line breaks as new paragraph) causes the xhtml export problems.

Replacing these nodes in the content.xml with </text:p><text:p> results in a valid odt file which can be exported correctly to xhtml. The attached file contains this fix.

An other way to create a exportable odt is to replace the special linebreaks (Shift + Enter) in Writer with normal paragraph switches (Enter).
Comment 7 Julian Jung 2017-11-16 14:10:42 UTC
Created attachment 137810 [details]
Path for the xsl transformation from odf to xhtml

The attached patch fixes some problems with the xsl transformation from odf to xhtml. multiple <draw:frame> tags divided by <text:s> or <text:line-break> in the same <text:p> tag are now transformed, too:

<text:p>
  <draw:frame> </draw:frame> 
  <text:s/>                    <--This nodes was lost without path!
  <text:line-break/>           <--This nodes was lost without path!

  <draw:frame> </draw:frame>   <--This nodes was lost without path!
</text:p>
Comment 8 QA Administrators 2018-11-17 03:47:02 UTC Comment hidden (obsolete)
Comment 9 Roman Kuznetsov 2018-11-23 08:35:53 UTC
still repro in

Version: 6.2.0.0.beta1
Build ID: d1b41307be3f8c19fe6f1938cf056e7ff1eb1d18
CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 10 QA Administrators 2019-11-24 03:36:18 UTC Comment hidden (obsolete)
Comment 11 mmaurer 2019-12-04 08:14:14 UTC
Bug is still present

Version: 6.3.3.2 (x64)
Build-ID: a64200df03143b798afd1ec74a12ab50359878ed
CPU-Threads: 8; BS: Windows 10.0; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded
Comment 12 Stéphane Guillou (stragu) 2021-05-18 13:27:40 UTC
Happy to report that this is fixed now. In LO 7.2 alpha0+, the second image and all the text show in an XHTML export.

The fix must have happened between 7.1 and 7.2.

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 6b09276d157abada74e1a4989700139167207778
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-05-14_04:32:30
Calc: threaded