Bug 118957 - Heading styles are changed after pasting html text
Summary: Heading styles are changed after pasting html text
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: HTML-Paste
  Show dependency treegraph
 
Reported: 2018-07-26 14:56 UTC by info
Modified: 2023-07-04 03:13 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example HTML (349 bytes, text/html)
2018-09-06 18:24 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description info 2018-07-26 14:56:41 UTC
Description:
After pasting some html text, e.g. from FireFox, into LibreOffice Writer, the text font defined under "Default" in the styles manager is applied to all sections except for headings. 
For sections enclosed in <hn>-tags (e.g. <h1>,<h2>) the font of the associated 
heading style will always be changed to "Liberation Serif".

Steps to Reproduce:
1. Empty page, all fonts set to "Liberation Sans" at 
"Tools > Options > LibreOffice Writer > Basic Fonts (Western)"

2. Paste some html text from FireFox:
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<p>Some <b>sample text</b> for demonstration</p>
<ul>
  <li>List 1</li>
  <li>List 2</li>
</ul>


Actual Results:
In the styles "Heading 1" and "Heading 2" the font is changed to "Liberation Serif". All other text remains in the default font.

Expected Results:
Headings should use the font assigned by the associated style


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Buovjaga 2018-09-06 18:24:51 UTC
Created attachment 144724 [details]
Example HTML

I reproduce, but the font displayed by browsers *is* a serif one, so I think we would get bug reports if we changed this.

Would prefer developer feedback.

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 033a68c49fe2b8aa397832d92d400eb0259ea809
CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3_kde5; 
Locale: fi-FI (fi_FI.UTF-8); Calc: threaded
Built on September 5th 2018

3.3.0 on Win 10
Comment 2 info 2018-09-07 10:01:51 UTC
Browser will display the font which is specified in the style information of the web page. This must not be a "serif" font. 

But, when pasting a snippet from a web page, no font information will be transferred (see my sample text in the bug report). Just check the pasted text using a normal text editor.
Comment 3 Buovjaga 2018-09-07 10:57:20 UTC
Yep, it's true that even if I have

<style>
h1, h2 {
font-family: sans-serif;
}
</style>

LibreOffice uses serif
Comment 4 QA Administrators 2019-09-08 05:03:17 UTC Comment hidden (obsolete)
Comment 5 info 2019-09-08 09:58:34 UTC
The bug is still present in LibreOffice Version 6.2.5.2 (x86)
Build-ID: 1ec314fa52f458adc18c4f025c545a4e8b22c15
Comment 6 info 2019-09-09 14:58:26 UTC
Same in version 6.3.1.2
Build-ID: b79626edf0065ac373bd1df5c28bd630b4424273
Comment 7 QA Administrators 2023-07-04 03:13:25 UTC
Dear info,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug