﻿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
37518	Named verbatim blocks mistake literal text for the closing tag	Mariano Ignacio Baragiola	Mariano Ignacio Baragiola	"On Django main (`03b95b8fba`), run:

{{{
#!python
from django.template import Context, Engine

source = (
    ""{% verbatim note %}before {% endverbatimnote %} after""
    ""{% endverbatim note %}""
)
print(Engine().from_string(source).render(Context()))
}}}

Expected: `before {% endverbatimnote %} after`

Actual: `TemplateSyntaxError: Invalid block tag on line 1: 'endverbatimnote', expected 'endverbatim'.`

The closing-tag matcher added in #35899 accepts zero whitespace between `endverbatim` and the block name. Requiring at least one whitespace character keeps the literal text inside the block. A local patch and regression test are ready.

AI disclosure: OpenAI Codex assisted with diagnosis, the patch and regression test, and drafting this report."	Bug	assigned	Template system	dev	Normal				Unreviewed	0	0	0	0	0	0
