mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[client] wayland/clipboard: prefer text/plain over text/html
When both text/plain and text/html are available, we should prefer the plain text as we can't paste HTML.
This commit is contained in:
parent
f3a1eaf557
commit
6419279c3c
@ -210,9 +210,10 @@ static void dataOfferHandleOffer(void * opaque, struct wl_data_offer * offer,
|
||||
if (type == LG_CLIPBOARD_DATA_NONE)
|
||||
return;
|
||||
|
||||
// text/html represents rich text format and should not be used when an image
|
||||
// format is available.
|
||||
if (isImageCbtype(type) && data->mimetypes[LG_CLIPBOARD_DATA_TEXT] &&
|
||||
// text/html represents rich text format, which is almost never desirable when
|
||||
// and should not be used when a plain text or image format is available.
|
||||
if ((isImageCbtype(type) || containsMimetype(textMimetypes, mimetype)) &&
|
||||
data->mimetypes[LG_CLIPBOARD_DATA_TEXT] &&
|
||||
strstr(data->mimetypes[LG_CLIPBOARD_DATA_TEXT], "html"))
|
||||
{
|
||||
free(data->mimetypes[LG_CLIPBOARD_DATA_TEXT]);
|
||||
|
Loading…
Reference in New Issue
Block a user