Bug 159507 - Calc editeng HTML paste: fragments are not supported
Summary: Calc editeng HTML paste: fragments are not supported
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:24.8.0 target:24.2.1
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-01 15:37 UTC by Miklos Vajna
Modified: 2024-02-06 19:35 UTC (History)
0 users

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 Miklos Vajna 2024-02-01 15:37:21 UTC
Copy a link from a web browser into Calc while cell edit is active, the clipboard can have this HTML markup:

<meta http-equiv="content-type" content="text/html; charset=utf-8"><a class="theme markdown__link" href="https://www.example.com/" rel="noreferrer" target="_blank"><span>https://www.example.com/</span></a>

If RTF is also on the clipboard then we prefer it, but in case that doesn't happen (e.g. mattermost chat app in firefox), then the above results in a non-working paste, because it lacks the expected HTML header.

The HTML paste into Calc's editeng was completely missing previously, but does work for the with-header case since ce53519f025158f8f64a4e8603c8c6e0dc35473a (cool#8023 editeng: support HTML paste, 2024-01-24).

Steps to reproduce:

1) copy to above content to the clipboard with the text/html mime type (e.g. copy in a web browser); use a clipboard manager like copyq on Linux to verify that the clipboard has the above content for text/html and RTF is not a type on the clipboard.
2) Start Calc, enter cell edit mode
3) Press Ctrl-V

Expected result: the example.com link appears in the cell text

Actual result: nothing happens (no error message)
Comment 1 Commit Notification 2024-02-02 08:09:33 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0503f6718f7686f3e2c93fc13af23e9fbfdace42

tdf#159507 editeng: support pasting HTML fragments

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 Commit Notification 2024-02-06 19:35:09 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/536096309f78de9eabac38ffb9c04bff95ea7d91

tdf#159507 editeng: support pasting HTML fragments

It will be available in 24.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.