﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21529	url tag urlencodes arguments irreversibly	leo@…	nobody	"Somewhere between 1.4 and 1.6 the url tag started urlencoding arguments before outputing the URL. This breaks code that wants to build the url inside javascript in the following way:

{{{
<script>
  var url = '{% url ""some_view"" ""'+some_js_argument+'"" %}'
</script>
}}}

On 1.4 this generates '/some/view/'+some_js_argument+'/'
On 1.6 this generates '/some/view/%27%2Bsome_js_argument%2B%27'


While I understand the rationale behind urlencoding per default, it would be nice to provide a way to avoid it. ""|safe"" seems to have no effect and even a custom filter to urldecode the output doesn't help, since urlencoding seems to be the last step before output.
Please consider providing a way to disable this, either by filter or by options to the url tag, so that we're not forced to use kludgy workarounds like 
{{{
<script>
  var url = '{% url ""some_view"" ""ARGUMENT_BY_JS"" %}'.replace(/ARGUMENT_BY_JS/, some_js_argument)
</script>
}}}

Additionally, this might be a good thing to mention in the docs.

This is admittedly somewhere between a bug and a feature request, but since this breaks old code, I've decided to submit it as a regression bug."	Cleanup/optimization	closed	Documentation	1.6	Normal	fixed	url tag urlencode javascript js		Accepted	1	0	0	0	0	0
