Please add support for pasting HTML fragments

Nothing is perfect! This is where you can post your ideas and wishes for functions you'd like to see in Help & Manual. Current version only please (H&M7).

Moderators: Alexander Halser, Tim Green

Post Reply
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Please add support for pasting HTML fragments

Unread post by Simon Dismore »

Please add support for pasting HTML fragments

I'm pasting a lot of Internet links into documentation topics. Often the link consists of an anchor and href (e.g. <A href="products_hm_features.html">publishing formats</A>). If I use the mouse to select the anchor text and press <ctrl>+C, both the anchor and href are copied to the clipboard. In applications like Word and Excel I can paste this and a hyperlink is created automatically.

It would be useful if the Page Editor would support pasting links in this way. I've put some more details below. Thanks for considering this,

Simon

To create a sample link, I browsed to http://www.ec-software.com/products_hm_overview.html, and highlighted the anchor publishing formats in the fifth paragraph, like this:
Capture of publishing formats link.PNG
I copied this to the clipboard. When I pasted it into H&M 6.0.2.2350 it was pasted as formatted text with no link. When I pasted it into Excel (2003 and 2010) and Word (2003 and 2010) it was pasted as a hyperlinked anchor.

I examined the clipboard using Microsoft's Clipboard Viewer Sample (http://msdn.microsoft.com/en-us/library ... 85%29.aspx) and saw that one of the formats on the clipboard was CF_HTML (also known as "HTML Clipboard Format"). Microsoft has documented it at http://msdn.microsoft.com/en-us/library ... 85%29.aspx. Using the clipboard viewer I confirmed that the text between <!--StartFragment--> and <!--EndFragment--> was <A href="products_hm_features.html">publishing formats</A><!--EndFragment--> as expected.

I also tried pasting into the RichViewActionsTest sample (downloaded from http://www.trichview.com/resources/acti ... ontest.zip). The result was a hyperlinked anchor. Since H&M's Page Editor is based on the RichView component, I am hoping that support for pasting HTML Format fragments from the clipboard can easily be added to H&M's Page Editor.
You do not have the required permissions to view the files attached to this post.
Simon Dismore
Posts: 454
Joined: Thu Nov 16, 2006 1:29 pm
Location: London, UK

Re: Please add support for pasting HTML fragments

Unread post by Simon Dismore »

In the details, I forgot to mention that the pasted hyperlink combines the base address with the anchor. In my example, the pasted target is http://www.ec-software.com/products_hm_features.html rather than just products_hm_features.html. I assume that this means that the pasting program performs some parsing of the CF_HTML "SourceURL:" field, which in this example was http://www.ec-software.com/products_hm_overview.html. I haven't gone deep into the sample source to see where this happens, but I do know that the RichViewActions Demo uses a freeware third-party component called RvHtmlImporter (source available at http://www.trichview.com/resources/) for pasting HTML from the clipboard.

Simon
User avatar
Tim Green
Site Admin
Posts: 23189
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Please add support for pasting HTML fragments

Unread post by Tim Green »

Hi Simon,

Thanks for the suggestion.

For the time being, you may be able to speed up link creation slightly by using HM's automatic URL conversion, although you do have to write the caption yourself: Instead of copying the entire hyperlink, right-click on it to copy just the URL to the clipboard. Then paste the URL in Help & Manual and press the spacebar once to convert it to a link. Then you can double-click on the new link and replace the <%LINK_CAPTION%> variable with the URL by pasting again (it's already selected), and then Ctrl-A in the caption field to change that.

Obviously, this is quite a few clicks, but it is another way of doing it. :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply