﻿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
33603	Backslashes in template tag arguments are escaped	bhch	nobody	"I've written a custom template tag to replace parts of a value:

{{{
@register.simple_tag
def string_replace(value, old, new):
    return value.replace(old, new)
}}}

And I'm using it to replace newline characters with commas in a user's address:

{{{
{% string_replace user.address '\r\n'  ',' %}
}}}

However, this doesn't work.

The reason is that when Django loads a template using Python's `file.read()` function, the backslashes get escaped which means `\r\n` becomes `\\r\\n`.

So, the `string_replace` tag actually receives `\\r\\n` instead of `\r\n`. This also affects other tags as well.

Shouldn't Django pass the original string argument to the template tag as intended?"	Cleanup/optimization	closed	Template system	3.2	Normal	wontfix			Unreviewed	0	0	0	0	0	0
