On 4/10/07, Jürgen Krämer <[EMAIL PROTECTED]> wrote:
Hi, me wrote: > > actually, the selected HTML code might be available from the clipboard. > E.g., both Firefox and Internet Explorer put it there in multiple > formats. The following are lists of the available formats after copying > from FF and IE, respectively: > > 49161: DataObject > 49422: text/html > 49366: HTML Format > 49776: text/_moz_htmlcontext > 49778: text/_moz_htmlinfo > 13: CF_UNICODETEXT > 1: CF_TEXT > 49171: Ole Private Data > 16: CF_LOCALE > 7: CF_OEMTEXT > > 49161: DataObject > 1: CF_TEXT > 13: CF_UNICODETEXT > 49366: HTML Format > 49330: Rich Text Format > 49171: Ole Private Data > 16: CF_LOCALE > 7: CF_OEMTEXT > > The formats starting with CF_ are pre-defined clipboard formats, the > remaining ones are registered through Windows' RegisterClipboardFormat() > function. I don't know how widely understood they are, but at least > Microsoft Word is able to render headlines and other HTML-formatting > instructions when text copied from Firefox is pasted into a document. > It seems, the clipboard object associated with "HTML Format" contains > enough information for correct rendering. > > A different point is how to access the HTML content in VIM. I doubt it > would be a good idea to always paste the HTML source when accessing the > clipboard through the + or * register. Probably a "pasteclipboard()" > function which takes an argument for determining the preferred format > would be a better way. This function function could then be used inside > a mapping whenever a VIM user wants to paste the original HTML source. sorry, I forgot to mention explicitly that this is totally Microsoft Windows-centric. But I think other OSs might also support multiple formats on the clipboard. Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin)
Yeah, I know it is somehow available in linux, even though most of the time it drives me crazy. I will copy paste a bunch of stuff into OO and it will format it all the way it was on the site. I'll bet that this could be done with a vim plugin that used a small external tool to get the html data copied. I assume external because I don't know how you could use vim to get at that information, but with C/C++ or even some scripting language it could probably be done. -fREW