﻿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
7295	quotes, escaping and translation of string literals handled inconsistently in templates	Antti Kaihola	nobody	"The Django template syntax sometimes accepts literal strings only in double quotes, whereas in other situations also single quotes work. Including a quote in a string by escaping it with a backslash doesn't work everywhere. Implementing !SmileyChris's [/ticket/5756#comment:4 suggestion] to #5756 (filter expressions as arguments for the {{{cycle}}}, {{{ifchanged}}}, {{{ifequal}}}, {{{firstof}}} and {{{include}}} tags) is difficult because of incosistencies in the underlying mechanisms.

String literals are dealt with in the !FilterExpression and Variable classes in [source:django/trunk/django/template/__init__.py django/template/__init__.py]. The classes contain two different and overlapping approaches to unquoting string literals. !FilterExpression embeds unquoting in the regex which parses filter expressions, and Variable takes a more ""manual"" approach.

With some modifications the following could be achieved:
 * both single and double quoted strings work everywhere
 * filters as template tag arguments easier to implement (see #5756)
 * escaping quotes works consistently
 * code re-use (DRY)

The challenge is to not lose performance."		closed	Template system	dev		fixed	tplrf-fixed		Accepted	1	0	1	0	0	0
