Django

Code

Ticket #4171 (closed: fixed)

Opened 2 years ago

Last modified 11 months ago

Forbid newlines in tags

Reported by: tonnzor <tonn81@gmail.com> Assigned to: adrian
Milestone: Component: Template system
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Newlines must be forbidden in tags. If tag contains newline (\n or \r) it should be processed as ordinary text.

Inspired by Templates: short comments {##} eats text

Attachments

forbide_newlines_in_tags.diff (1.1 kB) - added by tonnzor <tonn81@gmail.com> on 04/27/07 05:40:08.

Change History

04/27/07 05:40:08 changed by tonnzor <tonn81@gmail.com>

  • attachment forbide_newlines_in_tags.diff added.

04/27/07 07:16:22 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [5104]) Fixed #4164, #4171 -- Reworked some of the template lexer logic to ensure we don't get caught out by a couple of corner cases.

01/02/08 22:47:25 changed by anonymous

  • status changed from closed to reopened.
  • needs_better_patch changed.
  • resolution deleted.
  • needs_tests changed.
  • needs_docs changed.

This doesn't work for templates that extend other templates. Simple test case:

A.html:

   {% extends "B.html" %}
   {#
   foo
   #}

B.html:

   <h1>hello</h1>

This incorrectly hides {# foo #}.

01/03/08 01:44:01 changed by SmileyChris

  • status changed from reopened to closed.
  • resolution set to fixed.

That doesn't show anything - {% extends %} only replaces parent {% block %}s with ones in the child template so it hides any text you'd put outside a block tag.


Add/Change #4171 (Forbid newlines in tags)




Change Properties
Action