Bug 139949 - Nesting up of sections when going from odt to html and back
Summary: Nesting up of sections when going from odt to html and back
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks: Section (X)HTML-Export
  Show dependency treegraph
 
Reported: 2021-01-27 21:14 UTC by PhVerkerk
Modified: 2024-09-18 19:10 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sections as they are in the template (odt file) (1.21 MB, image/png)
2021-01-27 21:16 UTC, PhVerkerk
Details
Sections as they appear when saved in html and re-opened with Writer (1.22 MB, image/png)
2021-01-27 21:17 UTC, PhVerkerk
Details
This particular template (but the result is the same with different files) (20.12 KB, application/vnd.oasis.opendocument.text)
2021-01-27 21:20 UTC, PhVerkerk
Details
The HTML file corresponding to the template (24.99 KB, text/html)
2021-01-27 21:26 UTC, PhVerkerk
Details
The original odt file used as template (attachment in 169195) (20.12 KB, application/vnd.oasis.opendocument.text)
2021-02-11 07:57 UTC, PhVerkerk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description PhVerkerk 2021-01-27 21:14:24 UTC
Description:
I want to prepare a Latin text with the corresponding vocabulary and grammatical comments on the same page, with LO writer in order to have the possibility of post editing. Text, vocab-list and comments are prepared by other programs. To do that I prepare a template with three sections: one for the text, the second for the vocab-list and the last. Then I repeat that group of three sections on the next page.

To fill easily the sections, I convert the odt template to a html and recognize the tags <div id="Texte">...</div> and <div id="Grammaire"> etc... where I have to put my text, vocab and comments. Then, the last easy step consists in loading the html file into LO Writer and save as odt. It works apparently fine.

EXCEPT that the sections are now NESTED. The third one is a sub-section of the second. The fourth one and the fifth one are sub-sections of the third. And the last one is a sub-section of the fifth.

This is the case with two pages, i.e. six sections. What will happen with 100 pages ?

Steps to Reproduce:
1. Create a odt file with three sections, in the attached example they are called "Texte", "Grammaire" and "Definitions" (the text has a single column format, while the two others have two columns). Copy these three sections at the end of the document, they become "Section1", "Section2" and "Section3". The structure of the sections is flat (see Sections_in_template.png). Save that odt for reference.
2. Save as html this same file. Close that window.
3. Re-open the html file. Almost every thing seems OK (except for the header and the footer that are not present on each page, but it is easily restored). But looking at the structure of the sections they appear NESTED (see Back_in_Writer.png), as if a closing tag </div> has escaped to the detection.

Actual Results:
Nested sections (see Back_in_Writer.png). 
As if the html file contained 
<div id="Grammaire">...
    <div id="definitions">...
    </div>
while it contains
<div id="Grammaire">...
</div>
<div id="definitions">...
</div>


Expected Results:
The same flat structure of the sections as in the original odt file (see Sections_in_template.png)


Reproducible: Always


User Profile Reset: No



Additional Info:
As I save from odt to html and open again the html file in LO writer (even doing nothing in between), I expect a structure of the sections similar to the original one.
Comment 1 PhVerkerk 2021-01-27 21:16:00 UTC
Created attachment 169195 [details]
Sections as they are in the template (odt file)
Comment 2 PhVerkerk 2021-01-27 21:17:19 UTC
Created attachment 169196 [details]
Sections as they appear when saved in html and re-opened with Writer
Comment 3 PhVerkerk 2021-01-27 21:20:33 UTC
Created attachment 169197 [details]
This particular template (but the result is the same with different files)
Comment 4 PhVerkerk 2021-01-27 21:26:47 UTC
Created attachment 169198 [details]
The HTML file corresponding to the template
Comment 5 Dieter 2021-02-11 07:06:48 UTC
Thank you for reporting the bug. Could you please attach the odt-file, you've created in step 1? This would make it easier to reproduce the bug. Thank you.

=> NEEDINFO
Comment 6 PhVerkerk 2021-02-11 07:57:30 UTC
Created attachment 169664 [details]
The original odt file used as template (attachment in 169195)

Answer to comment#5
Comment 7 PhVerkerk 2021-02-11 08:02:15 UTC
As a matter of fact, it was already there as attachment 169197 [details] (comment#3). The HTML file is in 169198 (comment #4).
Comment 8 Dieter 2021-02-11 08:14:45 UTC
I confirm it with

Version: 7.1.0.3 (x64) / LibreOffice Community
Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Steps to reproduce
1. Open attachment from comment 3 or comment 5
2. Save as html
3. Reopen it
4. Open navigator => Sections

Actual result
Hierarchy of sections

Expected result
all sections on same level (like in original odt-file)
Comment 9 QA Administrators 2023-02-12 03:21:04 UTC Comment hidden (obsolete)
Comment 10 PhVerkerk 2023-02-12 14:44:15 UTC
Version: 7.4.5.1 / LibreOffice Community
Build ID: 9c0871452b3918c1019dde9bfac75448afc4b57f
CPU threads: 8; OS: Mac OS X 10.13.6; UI render: default; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded

The bug remains unchanged. Maybe worse in the sense that Writer does not take into account the page format (defined in the HTML) until a fake "Print" is performed (fake, because it does not need to be completed : I can click on the Cancel button, and do not need to actually print the document). The "Apply" button in the page format item is not sufficient.
Comment 11 Buovjaga 2024-09-18 19:10:21 UTC
Still repro.

The structure of the saved HTML changed in 4.1 with 15f8a130e2e1a3c920b02ad034d09e547e69ea57
Use <div> instead of <multicol> when exporting multi-column sections

This is what causes the nesting in the Navigator. I am not sure, if we can call this a regression.