Bug 155641 - XHTML Export: Writer does not preserve tabs
Summary: XHTML Export: Writer does not preserve tabs
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
7.5.3.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2023-06-01 21:05 UTC by teammember0x01
Modified: 2023-07-27 20:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Picture demonstrating what is wrong (590.78 KB, image/png)
2023-06-01 21:23 UTC, teammember0x01
Details

Note You need to log in before you can comment on or make changes to this bug.
Description teammember0x01 2023-06-01 21:05:10 UTC
Description:
I created a document in Writer and exported it as an HTML document. In the document was some code that had been indented using tabs. When the document is exported as HTML the code looses all its indentations. 

Steps to Reproduce:
1.Create a new text document.
2.Enter each word on their own line: One Two Three  
3.Indent the "Two" text by pushing the tab key.
4.Go to File->Export.
5.Select XHTML under File Type.
6.Save the document.
7.Open the document using a web browser (I used Safari).


Actual Results:
The "Two" is not indented correctly. It looks like there is only a space between the left margin and the "Two". 

Expected Results:
The "Two" text should be indented by the apparent size of the indent in the Writer document.


Reproducible: Always


User Profile Reset: No

Additional Info:
It looks like encoder does not consider tabs at all. Here is the code that was created:
 
</style></head><body dir="ltr" style="max-width:8.5in;margin-top:0.7874in; margin-bottom:0.7874in; margin-left:0.7874in; margin-right:0.7874in; ">
<p class="P1">One</p>
<p class="P1"><span> Two (should be indented)</span></p>
<p class="P1">Three</p>
</body></html>

The line "Two (should be indented)" has no code to even try to indent the text.

I believe that tabs should be translated into the margin-left CSS attribute with a value that approximates the size of the tab in the writer document.
Comment 1 teammember0x01 2023-06-01 21:13:17 UTC
I just tried LibreOffice 7.5.3.2. It also has the bug in it. The version field has been updated.
Comment 2 teammember0x01 2023-06-01 21:23:32 UTC
Created attachment 187653 [details]
Picture demonstrating what is wrong
Comment 3 Dieter 2023-06-17 11:03:22 UTC
I confirm it with

Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded