Bug 146015 - Output to HTML: Chapter numbering wrong
Summary: Output to HTML: Chapter numbering wrong
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.5.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2021-12-02 21:57 UTC by achim
Modified: 2023-12-23 12:08 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Chapter Numbering (181.39 KB, application/vnd.oasis.opendocument.text)
2021-12-02 21:57 UTC, achim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description achim 2021-12-02 21:57:54 UTC
Created attachment 176659 [details]
Chapter Numbering

The functions to generate (X)HTML have following problems/bugs:

1. numbering wrong in some cases
2. spacing between number and heading missing

For detailed description please see attached .odt.

(Didn't check tdf#99960 from 2016)
Comment 1 achim 2021-12-02 22:45:21 UTC
oops, missed another numbering bug in the attached document:
File->Send->Create HTML Document  generates one html file per chapter. They're linked in the first page. The number for the level 1 chapters there is correct.
But in all sub-pages --one for each chapter-- numbering of level 1 is always 1,
means for chapter 2, 3 and all others the numbering is 1, 1.1, 1.1.1, 1.2, etc. instead of 2, 2.1, 2.1.1, 2.2, ...
Comment 2 achim 2021-12-05 13:26:27 UTC
Bug about wrong numbering seems to be also reported in #tdf126716
Comment 3 achim 2021-12-05 13:30:02 UTC
Bug about spacing probably also reported in #tdf124526 (there for LO 7.2).
Comment 4 achim 2021-12-05 13:46:37 UTC
Spacing is also discussed in #tdf115326 .
I.g. I agree wih that discussion: HTML collapses any and all whitespaces to one single space, and tabs are not supported in HTML (unless pre tag is used).
As I described in my attached document, CSS can do the trick with min-length, but the challange for LO is to find the proper value for that min-length.

Just a guess: if there're tabs used in LO, set the style used for them with min-length:4em (which is roughly 8 characters). Of course, if the defined tabstop is larger, an greater value must be used. Also use at least one space (either simple space   or  ) in the span for the tab to ensure that there is always a space.
Comment 5 Dieter 2021-12-20 08:23:04 UTC
I confirm the different problems with

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: deea3b7471c3dab0220eca6146c225a2d47681a2
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

but as there is the basic rule "one problem one bug report" I recommend to reduce this bug report to one problem and open a new report for the second one.

First problem: Wrong numbering
Export as xhtml: Every chapter starts with chapter numbering 1
Save as html: O.K.
Create Html-document: Numbering of chapter 3 is again chapter 1 => uses a differnet list?

Second problem: Spacing after chapter numbering
Export as xhtml: Smaller space in level 1 (tab stop) and no space in level 2 and level 3(blank space)
Save as html: No space in all levels
Create Html-document: No space in all levels
Comment 6 achim 2021-12-21 10:36:05 UTC
Do you expect that I report two new issues now, or will it be done internally?
Comment 7 Dieter 2021-12-21 10:43:14 UTC
(In reply to achim from comment #6)
> Do you expect that I report two new issues now, or will it be done
> internally?

We should focus this report to the first problem (I changed bug summary). Please open a new report for the second problem. Thank you.
Comment 8 achim 2021-12-21 21:11:26 UTC
> Second problem: Spacing after chapter numbering

is now in #tdf146365
Comment 9 QA Administrators 2023-12-23 03:13:19 UTC Comment hidden (obsolete)
Comment 10 achim 2023-12-23 12:08:26 UTC
Quick test with 7.6.4.1
all bugs still exist.
Numbering of chapters is partially fixed: level 1 ist correct, all others are wrong because level 1 is missing in number of sub-levels.
Example (expected):
  A. Appendix 
    A.1. appendix level 2
  B. Beispiel

Example (current output):
  A. Appendix 
    1. appendix level 2
  B. Beispiel

Cheers achim

----
Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.utf8); UI: en-US
Calc: threaded