Opened 8 years ago

Closed 7 years ago

#4171 closed (fixed)

Forbid newlines in tags

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

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@…> 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by tonnzor <tonn81@…>

comment:1 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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 Changed 7 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution fixed deleted
  • Status changed from closed to reopened

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 Changed 7 years ago by SmileyChris

  • Resolution set to fixed
  • Status changed from reopened to closed

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