Bug 167445 - Writer Save As HTML wraps BR tags in Paragraph tags for empty lines
Summary: Writer Save As HTML wraps BR tags in Paragraph tags for empty lines
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2025-07-09 23:14 UTC by Justin
Modified: 2025-08-12 19:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX sample (9.73 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-07-09 23:15 UTC, Justin
Details
what Writer shows (32.91 KB, image/jpeg)
2025-07-09 23:15 UTC, Justin
Details
what the web page shows (28.74 KB, image/jpeg)
2025-07-09 23:15 UTC, Justin
Details
HTML output (2.03 KB, text/html)
2025-07-09 23:16 UTC, Justin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin 2025-07-09 23:14:36 UTC
Description:
If a line is empty (has only a return), the HTML will have a P and BR tag for that one line, creating two lines (plus margins) in the rendered page, which creates a lot of unnecessary white space and awkward formatting.

Export to HTML does not do this.

Steps to Reproduce:
1.open a DOCX that has empty lines
2.Save As > HTML
3.open the HTML file in a web browser

Actual Results:
observe any empty lines in the DOCX are doubled in the web page

e.g.,
<p class="western" align="justify" style="line-height: 100%; margin-bottom: 0in">
<br/>

</p>

Expected Results:
<p class="western" align="justify" style="line-height: 100%; margin-bottom: 0in">
</p>


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.2.3.2 (X86_64) / LibreOffice Community
Build ID: bbb074479178df812d175f709636b368952c2ce3
CPU threads: 16; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 1 Justin 2025-07-09 23:15:10 UTC
Created attachment 201723 [details]
DOCX sample
Comment 2 Justin 2025-07-09 23:15:35 UTC
Created attachment 201724 [details]
what Writer shows
Comment 3 Justin 2025-07-09 23:15:57 UTC
Created attachment 201725 [details]
what the web page shows
Comment 4 Justin 2025-07-09 23:16:19 UTC
Created attachment 201726 [details]
HTML output
Comment 5 mikhail.machine 2025-07-10 07:43:34 UTC
Hello Justin,

Thank you for reporting the bug. I can confirm that the bug is present in master.

Version: 25.2.4.3 (X86_64) / LibreOffice Community
Build ID: 33e196637044ead23f5c3226cde09b47731f7e27
CPU threads: 12; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: en-US (en_FI); UI: en-US
Calc: threaded

Extra <br/> are added.
Comment 6 raal 2025-08-12 19:28:40 UTC
Confirm with Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a0ae1b0cf2661e7be9ea042e5357530f5fb412f5
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

and Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)