0

I'm trying to create a hyperlink to a folder that has a space in it. The space is removed because of the way rst is processing the link.

Unfortunately I can't change the name of the folder because I'm not the owner.

This was solved below by adding %20 but now there is a second problem:

The path should be "file:///T:/my_path/A&B Tools".

It can also be represented as "\\network.com\my_path\A&B Tools".

* First link   `hyperlink-name-1`_
* Second link  `hyperlink-name-2`_

.. _hyperlink-name-1: file:///T:/my_path/A&B%20Tools
.. _hyperlink-name-2: \\\\network.com\\my_path\\A&B%20Tools

The first link works when I map network.com to T:

Edit:

Thanks to Steve I looked at the html I see when I use second link. The windows path starting with \ doesn't seem to work properly. I think this is a windows interpretation of the path.

eflanigan00
  • 481
  • 4
  • 12

2 Answers2

3

Try URL-encoding the space:

* A link  `hyperlink-name`_

.. _hyperlink-name: file://my_path/A&B%20Tools

EDIT

And now with your example above, Sphinx generates the following HTML:

<ul class="simple">
<li>First link   <a class="reference external" href="file:///T:/my_path/A&amp;B%20Tools">hyperlink-name-1</a></li>
<li>Second link  <a class="reference external" href="\\network.com\my_path\A&amp;B%20Tools">hyperlink-name-2</a></li>
</ul>

I suspect you copy-pastad an invisible character (gremlin) into your .rst file. I noticed that you mixed examples in your question, too: A&B Tools vs. M&S Tools. I'd slow down and check all my assumptions.

Steve Piercy
  • 13,693
  • 1
  • 44
  • 57
  • Thank you that worked, I've updated the question above. – eflanigan00 Jul 03 '17 at 21:52
  • Updated, and thanks for the tip. Now that I look at the html I see when I use the windows path with \\network.com\ it doesn't like the use of %20 and maybe the &. The file:/// link works perfect. – eflanigan00 Jul 05 '17 at 13:54
  • Not sure what you mean by "doesn't like". But if my answer is correct, please accept it. Thank you! – Steve Piercy Jul 05 '17 at 17:50
1

Thank you Steve for helping me. I needed five slashes file://///server01/my_path/ as shown here:

What are the ways to make an html link open a folder

eflanigan00
  • 481
  • 4
  • 12