﻿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
35790	Deprecate content outside of {% block %} tags when {% extends %} is used	Adam Johnson	Yogya Chugh 	"Currently, content outside of `{% block %}` tags in an extending template is silently discarded. This could be a source of bugs, where written content may appear to be rendered at first glance, but isn't.

I propose we deprecate allowing non-whitespace text nodes outside of `{% block %}` tags, when `{% extends %}` is used. I don't think we can disallow tags because they might be tags like `{% load %}` or `{% comment %}` or a custom tag with other side effects.

For example, take this base template `egg.html`:

{{{
{% block yolk %}
hi
{% endblock yolk %}
}}}

And an extending template, `chicken.html`:

{{{
{% extends 'egg.html' %}

<title>Chicken egg</title>

{% block yolk %}
yellow
{% endblock yolk %}
}}}

The `<title>` content is silently discarded:

{{{
In [1]: from django.template import loader

In [2]: loader.get_template(""chicken.html"")
Out[2]: <django.template.backends.django.Template at 0x17431a950>

In [3]: loader.get_template(""chicken.html"").render()
Out[3]: '\nyellow\n\n'
}}}"	Cleanup/optimization	closed	Template system	dev	Normal	wontfix		Sanjeev Holla S	Accepted	1	0	0	1	0	0
