Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-07-23 12:42:10

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

[textile] %20 in a url doesn't work.

When I try to use textile to create a link to a URL that contains a space, I’m finding that the “%20“s used in the file name are being changed to %2520 which obviously breaks the link.

Unfortunately I don’t have access to the documents that are being linked to in order to remove the space.

Without resorting to html, is there anything else I can do?

Offline

#2 2013-07-23 15:25:27

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: [textile] %20 in a url doesn't work.

An article wrapped in …

<txp:rah_replace from="%2520" to="%20">
	Article
</txp:rah_replace>

… will work.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2013-07-30 10:21:52

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: [textile] %20 in a url doesn't work.

Thanks Uli, that works a treat. Is this something that needs to be fixed in textile? Should I report it somewhere?

Offline

#4 2013-07-30 12:35:44

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] %20 in a url doesn't work.

I can not reproduce this. The following:

"Wiked space snakes":http://example.com/wiked%20rattling%20snakes

Generates:

<p><a href="http://example.com/wiked%20rattling%20snakes">Wiked space snakes</a></p>

Offline

#5 2013-07-30 16:01:42

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: [textile] %20 in a url doesn't work.

Thats usually a problem with “office” PDFs (or: that’s where I know them from). Try those with an HTTP link.

Edit 2: Hm, I have enough %2520s in my source code. Even with html suffixes and all plugins off. Weird results.

Last edited by uli (2013-07-30 16:41:40)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#6 2013-07-30 19:51:50

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: [textile] %20 in a url doesn't work.

It’s fine when you specify the full url, but when you use a relative (local) path, bad things happen.

Try:

"Wiked space snakes":/basket%20of%20snakes/wiked%20rattling%20snakes

Which generates:

<p><a href="/basket%2520of%2520snakes/wiked%2520rattling%2520snakes">Wiked space snakes</a></p>

Offline

#7 2013-07-30 20:40:01

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: [textile] %20 in a url doesn't work.

I get %2520s even on URLs that point into the wild. Clean vanilla 4.5.4. Wanted to exclude that it might stem from plugin traces (like hak_tinymce) and quickly set up a new TXP.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#8 2013-07-31 12:42:26

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: [textile] %20 in a url doesn't work.

uli wrote:

Clean vanilla 4.5.4.

Textpattern 4.5.x was released last year, which means it uses year old Textile version. Taking a peek at the changelog, this particular issue with URL encoding was fixed 8 months ago in 2.5.0/3.5.0 releases.

douglgm wrote:

Try

I still can not reproduce it either on master, 2.5-dev, v2.5.1 or v3.5.1, or with Textpattern 4.6-dev. It consistently generates:

<p><a href="/basket%20of%20snakes/wiked%20rattling%20snakes">Wiked space snakes</a></p>

Offline

Board footer

Powered by FluxBB