How to use spaces in relative links

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use spaces in relative links

confuseddesi
Hi all,

I would like to insert a link that looks as follows:

* link:assets/Marketplace - Guide.pdf[Manual^]

but because there are spaces in the file name, the link won't render. How can I circumvent this?
Reply | Threaded
Open this post in threaded view
|

Re: How to use spaces in relative links

mojavelinux
Administrator
There are two ways to solve this problem.

Option 1: Use %20 to represent a space

link:assets/Marketplace%20-%20Guide.pdf[Manual^]

Option 2: Use {space} or {sp} to represent a space

link:assets/Marketplace{space}-{space}Guide.pdf[Manual^]

Technically, option 1 is more correct since you're not supposed to have spaces in a URL. %20 is a URL-encoded space, hence a legal way to put a space in a URL.

This point should be added to the chapter in the manual on URLs, http://asciidoctor.org/docs/user-manual/#url.

-Dan

On Wed, Sep 10, 2014 at 10:56 PM, confuseddesi [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi all,

I would like to insert a link that looks as follows:

* link:assets/Marketplace - Guide.pdf[Manual^]

but because there are spaces in the file name, the link won't render. How can I circumvent this?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-to-use-spaces-in-relative-links-tp2185.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--