﻿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
10136	django should not insert newlines in generated html at places where the template has  comments	sarang@…	nobody	"I am using django 1.0.2 (1.1 pre-alpha) with python 2.5.2 and I noticed that wherever I insert a comment line in the template file, django adds a newline to the generated html. I believe that this is not ideal as it causes comment lines to have some effect on the generated html. More importantly, this prevents me from adding comments at the beginning of template files as then the generated html has a blank line as its first line, making it non-compliant with xhtml 1.1. The same code generated with a template that does not have a comment at its beginning validates perfectly.

Steps to reproduce:

1. Have a template that begins with comments:
{{{
{# Elements / tags with attributes are inside their corresponding block to enable modification of attributes by descendant templates. #}
{# Elements / tags without attributes are outside their block so that only the content enclosed by them needs to be in descendant templates #}
{% block doctype %}<?xml version=""1.0"" encoding=""UTF-8""?>
<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.1//EN""
	  ""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"">
{% endblock %}
}}}
2. Generate some html using it. The generated html will have blank lines at its beginning and will not validate at the W3C markup validator."		closed	Template system	dev		invalid		sarang@…	Unreviewed	0	0	0	0	0	0
