Bug 111492 - XHTML export does not honor numbering levels
Summary: XHTML export does not honor numbering levels
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.0.0 target:5.4.1 target:5.4....
Keywords:
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2017-08-08 11:31 UTC by Laurent Godard
Modified: 2020-04-16 12:33 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
the odt source file (8.57 KB, application/vnd.oasis.opendocument.text)
2017-08-08 11:31 UTC, Laurent Godard
Details
the (faulty) xhtml export (3.25 KB, text/html)
2017-08-08 11:31 UTC, Laurent Godard
Details
diff mentioned in the comment (561 bytes, patch)
2017-08-08 23:46 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Godard 2017-08-08 11:31:09 UTC
Created attachment 135273 [details]
the odt source file

in the given odt file

Heading 1 has no numbering style
Heading 2 has level 1 numbering
Heading 3 has level 2 numbering

xhtml export shows wrong numberings of exported h1, h2, h3

and wrong indentation after the numbering (missing spaces)
Comment 1 Laurent Godard 2017-08-08 11:31:49 UTC
Created attachment 135274 [details]
the (faulty) xhtml export
Comment 2 Regina Henschel 2017-08-08 23:45:51 UTC
The transformation does not evaluate the attribute "text:list-level-position-and-space-mode". In current versions of LibreOffice it has the value "label-alignment" and only when saving in ODF1.1 you get the value "label-width-and-position". The transformation assumes the latter, old kind one. If you use the old kind, then the transformation sets correct distance values.

Because the attribute is not evaluated, the element <style:list-level-label-alignment> is not evaluated too. It does not exists for old kind of list numbering. Therefore the transformation does not know, that a space or tab is requested.

As temporarily workaround till the transformation is extended to recognize this attribute, it is possible to always add a space after the last digit of the label numbers. That is in line #1403 in file https://opengrok.libreoffice.org/xref/core/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl, see attached diff-file. You can change the file body.xsl in your installation in share/xslt/export/xhtml without the need to compile entire LibreOffice. The diff will likely not apply because of line breaks, but entering &#160; manually should be no problem.

If you need the export to xhtml immediately and do not want to correct the xhtml-result manually, then you should use the old kind of numbering. If you have saved such numbering once by the button "Format" in the Outline Numbering dialog from an ODF1.1 document, it will be available for ODF 1.2 documents via button "Format".
Comment 3 Regina Henschel 2017-08-08 23:46:54 UTC
Created attachment 135326 [details]
diff mentioned in the comment
Comment 4 Regina Henschel 2017-08-08 23:52:31 UTC
I think, the fact, that numbering "none" is not honored in sub-levels, is a different problem and should perhaps get its own bug report.
Comment 5 Commit Notification 2017-08-11 06:37:29 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=46b4eb8b0e9325f8c29cd391baf9504bccee1837

tdf#111492 Honor ODF 1.2 style tab indentation in XHTML export

It will be available in 6.0.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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2017-08-11 17:59:43 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d8c4c6946e5dc3b1756294496e7fac1d343aadea&h=libreoffice-5-4

tdf#111492 Honor ODF 1.2 style tab indentation in XHTML export

It will be available in 5.4.1.

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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2017-09-05 08:37:56 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c284e1de170add762906658b1f44e7d11a370c5e

tdf#111492: XHTML export does not honor numbering levels

It will be available in 6.0.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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Julien Nabet 2017-09-05 08:39:51 UTC
Thank you Samuel.
Let's put this one to FIXED then.
Comment 9 Commit Notification 2017-09-06 14:41:15 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4fa014099e99d91088f55b15273117fd0fc26679

tdf#111492 Numbering: entry B.1 is exported as 2.1

It will be available in 6.0.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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2017-09-07 14:01:13 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=94b583dccc90651bc6366c2a85813d91b708496f&h=libreoffice-5-4

tdf#111492 XHTML export does not honor numbering levels

It will be available in 5.4.2.

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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2017-09-13 19:27:03 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6b9470405f63e169ce9098797213c4520f053811&h=libreoffice-5-4

tdf#111492 Numbering: entry B.1 is exported as 2.1

It will be available in 5.4.2.

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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2020-04-16 12:33:23 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/acedbb8692bc84c93114dc4d441b3eb20b3ac467

tdf#107696, tdf#111492: xhtml: Add unittest

It will be available in 7.0.0.

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

Affected users are encouraged to test the fix and report feedback.