Up to version 6.3, it was common for Writer (like OpenOffice Writer) to take HTML comments when importing HTML documents.
Since version 6.4, HTML comments seem to get lost upon HTML import.
Use Case: Generate documents by scripting, with extra metadata (such as section summaries) shown as comments.
Steps to Reproduce:
1. Generate a simple valid HTML document with some HTML comments inserted within paragraphs.
2. Open the document with Writer.
The document does not contain any comments.
Each HTML comment is converted into a Writer comment and shows up at least in the navigator.
User Profile Reset: No
Behaviour has changed since LibreOffice version 126.96.36.199.
Deinstalling version 188.8.131.52 and going back to version 184.108.40.206 fixes the problem.
Would you please attach one minimum html file "with extra metadata (such as section summaries) shown as comments"?
Created attachment 157741 [details]
A html example file
Peter, following your steps, I can can see no difference between the html file opening with Writer or with Firefox or Chrome.
I'm not familiar with html-files, but whre can I see html comments within your file? Do I need a special editor?
Open attachment 157741 [details] with
220.127.116.11 : see 3 comments
18.104.22.168.alpha : no comments shown
Possible to use 22.214.171.124.alpha to save comments in an .html file, but on "reload" the comments are not visible. (but they are visible in 126.96.36.199)
(To see comments, open the .html file with a text editor (e.g., Notepad in Windows, vi or kate in linux). Look for entries that start "<!--" and end "-->"
The text strings between the -- will appear in 6.3.x, but not in 188.8.131.52.alpha. )
I also see comments in
Version: 184.108.40.206 (x64)
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win;
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
but not in
Version: 220.127.116.11.alpha0+ (x64)
Build ID: eeb2d19e77d6dc47c68e8ba0920a02cf64a1247b
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win;
Locale: de-DE (de_DE); UI-Language: en-GB
I want to clarify that I am referring to the component "swriter.exe" and not to the HTML editor component "sweb.exe" (which reads HTML files by default). The problem occurs when converting between HTML and ODT.
Note: Web browsers usually don't show HTML comments.
Regression introduced by:
author Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> 2019-09-06 10:50:49 +0200
committer Thorsten Behrens <Thorsten.Behrens@CIB.de> 2019-09-06 15:30:00 +0200
commit 9219242d42b7b0e5b00d7a1997cc7fcf35894627 (patch)
parent 77e39d55457385eb1585034e8e461ad9ba77e707 (diff)
Disable inserting HTML comments as notes by default
Bisected with: bibisect-linux64-6.4
Adding Cc: to Samuel Mehrbrodt
@Samuel, so it seems some people use comments in html files.
Would it be possible to hide them by default and make it possible to show them from the View menu ?
So there is already a config option for this. Search expert config for "IgnoreComments" and set to false.
I don't see any reason why this should be on by default, as usually html comments are not meant to be seen by the user.
In the special case mentioned by the bug reporter, he should just switch the config option.
Perhaps Samuel's advice should be added to the relevant help page:
(I could make that change -- but would need advice about a correct formulation. I guess a sentence at the end of the "Import Tips" section?)
or if this is a common action, then perhaps this control should be added as a checkbox in Tools - Options - Load/Save - HTML Compatibility?
I had a look at commit 9219242d42b7b0e5b00d7a1997cc7fcf35894627 causing the new behaviour.
Obviously, there was no requirement for that modification.
I suggest to revert the change and not to bloat LibreOffice's user interface.
(In reply to peter.88213 from comment #10)
> I had a look at commit 9219242d42b7b0e5b00d7a1997cc7fcf35894627 causing the
> new behaviour.
> Obviously, there was no requirement for that modification.
> I suggest to revert the change and not to bloat LibreOffice's user interface.
The fix was done primarily for LibreOffice Online. When copying/pasting any text on Windows 10, Windows would automatically add comments like "<!--StartFragment-->" and "<!--EndFragment-->". Those were then imported by LO Online when pasting any text.
thank you for clarifying the issue. Since the problem does not apply to the desktop version (I just tested it on Win 10 / LO18.104.22.168 / Firefox and Edge), I suggest to restrict the modification to the online version.
Differences in behaviour between desktop and online variants are more likely to be accepted than changed behaviour upon update (may I remind of all the frustrating experiences with "windows as a service"?).