Bug 155641

Summary: XHTML Export: Writer does not preserve tabs
Product: LibreOffice Reporter: teammember0x01
Component: filters and storageAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: dgp-mail, telesto
Priority: medium    
Version: 7.5.3.2 release   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=124526
https://bugs.documentfoundation.org/show_bug.cgi?id=70131
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108799    
Attachments: Picture demonstrating what is wrong

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