Sharepoint insists it knows the link to my UNC and won't let me remove hyperlink formatting

4

1

We have a file share at work (one I do not have the power to rename) and it contains a space in it:

\\WorkFileShare\Visual Studio\SP1

I'm creating a Wiki Entry that informs users they can locate the VS2010 SP1 download on this Share.

For some reason, SharePoint will highlight and hyperlink the UNC up to the space. (I've been dealing with this behavior for years in Outlook and I fix by putting focus on the character before the space and then hitting backspace to remove the formatting).

Simple enough and SharePoint also removes the formatting when you backspace on the character before the space.

However, as soon as I move away from the link, SharePoint goes right back to highlighting and hyperlinking what it thinks is the UNC.

Naughty Sharepoint!!

So does anyone have any idea how to clear the formatting?

NOTE: Highlighting the text and clicking on the "Clear Format" icon does not work.

ray023

Posted 2011-03-22T17:16:07.730

Reputation: 1 387

Tumbleweed badge! Yay! – ray023 – 2011-04-01T20:34:08.270

Answers

5

While editing a SharePoint Wiki Article. Do the following:

  1. Type (or Paste) your UNC filepath containing the space (e.g. \WorkFileShare\Visual Studio\SP1) (SharePoint should autoformat this to a hyperlink)
  2. Click the Edit HTML Source Icon
  3. Find the UNC Path in the HTML Markup (I usually copy and paste the markup into Notepad++ because I need color-coded help :P ) The link will look something like this:
    <A href="file://\\WorkFileShare\Visual">\\WorkFileShare\Visual</A> Studio\SP1
  4. The href portion will cut off after the first space. You will need to complete the rest of file link and replace spaces with %20.
  5. Move the closing anchor html (</a>) to the end of text
  6. Click OK

Once finished, the html should look something like this:

<A href="file://\\WorkFileShare\Visual%20Studio\SP1">\\WorkFileShare\Visual Studio\SP1</A>

Even after I doing this, clicking on the link did nothing; which probably has something to do with SharePoint.

However, I can right-click on the link, select copy shortcut, paste that shortcut into a browser window.

ray023

Posted 2011-03-22T17:16:07.730

Reputation: 1 387

hirogen - sorry I missed you in the #sharepoint irc - I was feeding sheep. I'm glad you figured it out. I hate Sharepoint, don't you? – bgmCoder – 2018-04-09T01:53:52.387

The problem with this answer is that it corrupts the original URL. \WorkFileShare\Visual Studio\SP1 became (just what was inside the HREF quotes): file://\WorkFileShare\Visual so, moving the final anchor (</a>) fixes the DISPLAYED link, but not the actual address. The root issue here seems to be that the original UNC link destination includes spaces, which are not allowed in HTML addresses/links. So, I suspect that all spaces or other special characters will need to be replaced with their corresponding escape codes (e.g. space → %20). – None – 2012-03-21T21:12:37.957

The information helped me improve my answer so thank-you for that. Final note, my answer does not corrupt the URL; SharePoint is the culprit of that. – ray023 – 2012-03-23T13:33:08.520

technically, the space in it is not a corruption, but a malformation. spaces are not allowed in URLS. They are also not really allowed in file paths either unless it is delimited by quotes – horatio – 2012-03-23T13:55:13.027