[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Yanking as HTML
From: |
Yuri Khan |
Subject: |
Re: Yanking as HTML |
Date: |
Sun, 30 Oct 2016 16:59:15 +0600 |
On Sun, Oct 30, 2016 at 5:43 PM, Lars Ingebrigtsen <address@hidden> wrote:
> (gui-get-selection 'CLIPBOARD 'TARGETS)
> => [TIMESTAMP TARGETS MULTIPLE SAVE_TARGETS UTF8_STRING COMPOUND_TEXT TEXT
> STRING]
>
> Hm... so it lacks the "text/html" target that xclip -o -t TARGETS
> lists?
Your xclip invocation targets the PRIMARY selection (by default) while
the elisp snippet examines CLIPBOARD. This might be a reason for the
difference you observe.
In my test, text/html was present and I was able to see it as an Emacs
propertized string containing HTML tags.
Note that, in general, it is impossible to correctly copy-paste styled
HTML between documents:
* If you paste only the HTML, half the users will complain that “what
you get” in the target document differs from “what you see” of the
source document.
* If you paste both the HTML and CSS of the source, you introduce a
non-local effect (HTML is pasted at point while CSS needs to be pasted
at a different location).
* In a misguided attempt to sidestep the issue above, some programs
parse the HTML and CSS and apply CSS as direct formatting (HTML
style="" attribute). At this point, the other half of the users
(myself included) will complain that direct formatting is evil and any
tool that produces such where there was none is broken.
Re: Yanking as HTML, Daniel Colascione, 2016/10/30
Re: Yanking as HTML, YAMAMOTO Mitsuharu, 2016/10/30
- Re: Yanking as HTML, Lars Ingebrigtsen, 2016/10/30
- Re: Yanking as HTML,
Yuri Khan <=
- Re: Yanking as HTML, Lars Ingebrigtsen, 2016/10/30
- Re: Yanking as HTML, mituharu, 2016/10/30
- Re: Yanking as HTML, Lars Ingebrigtsen, 2016/10/30
- Re: Yanking as HTML, Lars Ingebrigtsen, 2016/10/30
- Re: Yanking as HTML, Ted Zlatanov, 2016/10/31
- Re: Yanking as HTML, Lars Ingebrigtsen, 2016/10/31
- Re: Yanking as HTML, Eli Zaretskii, 2016/10/31
Re: Yanking as HTML, Lars Ingebrigtsen, 2016/10/30
Re: Yanking as HTML, Igor Sosa Mayor, 2016/10/30