Bug with pasting hyperlinks containing anchors

3 posts, 0 answers
  1. Steve
    Steve avatar
    20 posts
    Member since:
    Jan 2011

    Posted 26 May Link to this post

    Hi,

    I noticed that if you paste a hyperlink containing an anchor such as this into a RichTextBox, everything except the anchor's name will be removed from the href attribute, resulting in links that do not work.

    Do you have any advice or tips on a way to work around this?

    Thanks

  2. Steve
    Steve avatar
    20 posts
    Member since:
    Jan 2011

    Posted 26 May Link to this post

    Amendment:

    This only seems to be a problem when pasting from MS Office products such as Word or Outlook. Pasting from a web browser seems to work as expected

  3. UI for WPF is Visual Studio 2017 Ready
  4. Tanya
    Admin
    Tanya avatar
    402 posts

    Posted 31 May Link to this post

    Hi Steve,

    Thank you for the provided information.

    I managed to reproduce the issue and added it to our backlog. You could subscribe to receive updates about status changes on it through the related public item. I added some Telerik points to your account as a token of appreciation for bringing this to our attention.

    Depending on the source, the pasted content is imported with different format providers and the issue is related to the RtfFormatProvider, which is used by default when pasting content from MS Word and MS Outlook. When pasting from a browser, the clipboard passes the content as HTML thus, the HtmlFormatProvider is used.

    As a workaround, you could try changing the ClipboardHandlers of RadRichTextBox as described in this help article

    Hope this helps.

    Regards,
    Tanya
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top