Bug 93897 - Save as HTML adds superfluous <br/> in blank paragraph
Summary: Save as HTML adds superfluous <br/> in blank paragraph
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: (X)HTML-Export
  Show dependency treegraph
 
Reported: 2015-09-03 19:29 UTC by Michael Adams
Modified: 2023-07-13 13:31 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Adams 2015-09-03 19:29:45 UTC
Saving an odt file as html can create two blank lines where there should be just one blank line.

The user creates a blank line by pressing Enter. This creates a single CRLF in the document.

When exported to html, the single CRLF becomes:
<p style="margin-bottom: 0in; line-height: 100%"><br/>

</p>

The <br/> should not be there. It makes 2 blank lines instead of one.
Comment 1 Buovjaga 2015-09-14 09:31:46 UTC
Reproduced.

Win 7 Pro 64-bit, Version: 5.0.1.2 (32-bit)
Build ID: 81898c9f5c0d43f3473ba111d7b351050be20261
Locale: fi-FI (fi_FI)
Comment 2 raal 2015-10-29 12:17:37 UTC
Reproducible with LibreOffice 4.0.0.3
Comment 3 QA Administrators 2016-11-08 11:53:49 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2019-12-03 14:46:19 UTC Comment hidden (obsolete)
Comment 5 Stéphane Guillou (stragu) 2021-07-01 07:58:30 UTC
Reproduced by saving as HTML (but not when exporting as XHTML).
The empty paragraph has an extra, superfluous "<br/>".
Interestingly, Firefox 89 does not "double up the space". It only shows one single blank paragraph.

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: f446a203fa2897bab8ae7686c948a8bf060675c6
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-06-24_15:16:38
Calc: threaded

Changing the summary to refer to saving as HTML instead.
Comment 6 Sophie Sipasseuth 2023-06-30 08:58:10 UTC
The bug seems not to be present in this version of LO:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9fc0b2b9b96d87eb642a3b29e9dcb5d6273265eb
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 7 Stéphane Guillou (stragu) 2023-07-13 13:31:56 UTC
I also see that <br> in empty paragraphs when saving as HTML in OOo 3.3, so this behaviour is inherited.

However, I am closing as "not a bug" because, if one removes that <br> in the source, you'd end up with no paragraph at all, so an HTML file that is not true to the original file.

I also checked that reloading the HTML file in Writer does not duplicate the space, so import behaves as expected too.

Tested with Firefox 115.0, Chrome 114.0.5735.198 and a recent master build of LO.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 77fca616e0bd79e0b405fd0b3543cf8e94e15df3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

(The structure of the source could be improved, by keeping the closing </p> on the same line, but that's just cosmetic).