Bug 133882 - SAVE AS HTML: Missing "__RefHeading___Toc" anchor for Headlines when Tables are used
Summary: SAVE AS HTML: Missing "__RefHeading___Toc" anchor for Headlines when Tables a...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.3.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2020-06-10 22:08 UTC by Jens Schwartz
Modified: 2022-09-27 06:09 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
source .odt (14.88 KB, application/vnd.oasis.opendocument.text)
2020-06-10 22:09 UTC, Jens Schwartz
Details
exportel .html (6.50 KB, text/html)
2020-06-10 22:12 UTC, Jens Schwartz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Schwartz 2020-06-10 22:08:22 UTC
Description:
created an .odt, this includes
- index of headlines
- headlines inside tables (td>tr>td>h3...)
- headlines in body (h3)

when this is mixed in the document the HTML export is missing the "__RefHeading___Toc" anchor inside the headline tag when headline is placed in the SECOND variant - no matter in wich order they appear.

Eexample 1:
after index the 1st headline is in body:

<h3 class="western"><a name="__RefHeading___Toc3933_840939253"></a>Link
to Google (Test Non-TR)</h3>

this does now work for all headlines outside tables.


the following headlines inside tables do not get the RefHeading:

<table width="100%" cellpadding="6" cellspacing="0">
	<col width="256*"/>

	<tr>
		<td width="100%" valign="top" style="border: 1px solid #000000; padding: 0.1cm"><h3 class="western">
			Link to Google (Test TR)</h3>


this is exactly the same inverse:
if the 1st appearance of a headline is inside the TD tag all this headlines get the RefHeadin, but none of the body headline (outside tables) do so.



Steps to Reproduce:
1. create an .odt
2. create a headline
3. create a TOC
-- add some paragraphs to have good jump-view --
4. below the TOC create a headline
-- add some paragraphs to have good jump-view --
5. bleow create a table
6. in a cell create a headline
7. update the TOC
8. export to HTML
9. try out the links in TOC
--> you will find the TOC link to the 1st headline (non-table) after TOC (step 4) working (HTML includes RefHeading in <H> tag)
--> you will find the TOC link to the 2nd headline (table) after TOC (step 4) not working (HTML does not include RefHeading in <H> tag)

10. built similar .odt but now 1st create a table after TOC and add a headline there, and after table a headline in the body
--> you will find the TOC link to the 1st headline (table) after TOC working (HTML includes RefHeading in <H> tag)
--> you will find the TOC link to the 2nd headline (non-table) after TOC not working (HTML does not include RefHeading in <H> tag)

Actual Results:
TOC links in HTML export do not work for each 2nd variant of appearance of headlines

Expected Results:
each TOC link should trigger a jump to the resp. headline


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.4.3.2 (x86)
Build-ID: 747b5d0ebf89f41c860ec2a39efd7cb15b54f2d8
CPU-Threads: 8; BS: Windows 10.0 Build 18363; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE

since this is an parsing/transformation issue I did not reset profile + did not check OpenGL status
Comment 1 Jens Schwartz 2020-06-10 22:09:37 UTC
Created attachment 161866 [details]
source .odt

this is an example of source .odt
Comment 2 Jens Schwartz 2020-06-10 22:12:59 UTC
Created attachment 161867 [details]
exportel .html

this is the export of the source to HTML
you can see
- the existing "RefHeading" in line 126
- the missing "RefHeading" in line 137
Comment 3 Dieter 2020-09-22 19:26:13 UTC
I confirm bug in step 9 with your attachment and

Version: 7.0.1.2 (x64)
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 4; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: threaded

Would be nice, if you also could add an example for step 10. Thanks.
Comment 4 Jens Schwartz 2020-09-27 16:43:07 UTC
Seems I did something wrong or the step 10 does not appear in later versions.

Was _not_ able to reproduce step 10 in version 6.4.6.2 (Win, Portable, "Still").

But found: Missing anchor __RefHeading___ inside tables in exported HTML _independend_ from position of table.
Ancor is also missing when table contains 1st appearance of headlines.


Version: 6.4.6.2 (x86)
Build-ID: 0ce51a4fd21bff07a5c061082cc82c5ed232f115
CPU-Threads: 8; BS: Windows 10.0 Build 18363; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded

and

Version: 7.0.1.2 (x86)
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded
Comment 5 Dieter 2022-09-27 06:09:55 UTC
Works now with

Version: 7.4.1.2 (x64) / LibreOffice Community
Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0
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

=> RESOLVED WORKSFORME