Opened 18 years ago

Closed 17 years ago

#4171 closed (fixed)

Forbid newlines in tags

Reported by: tonnzor <tonn81@…> Owned by: Adrian Holovaty
Component: Template system Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 (1)

forbide_newlines_in_tags.diff (1.1 KB ) - added by tonnzor <tonn81@…> 18 years ago.

Download all attachments as: .zip

Change History (4)

by tonnzor <tonn81@…>, 18 years ago

comment:1 by Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

(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.

comment:2 by anonymous, 17 years ago

Resolution: fixed
Status: closedreopened

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 #}.

comment:3 by Chris Beaven, 17 years ago

Resolution: fixed
Status: reopenedclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top