##// END OF EJS Templates
templater: strip whitespace inside template methods
Matt Mackall -
r10854:40366345 default
parent child Browse files
Show More
@@ -139,17 +139,18 b' class engine(object):'
139
139
140 if '%' in expr:
140 if '%' in expr:
141 key, t = expr.split('%')
141 key, t = expr.split('%')
142 parsed.append((self._format, (key, self._load(t))))
142 parsed.append((self._format, (key.strip(),
143 self._load(t.strip()))))
143 elif '|' in expr:
144 elif '|' in expr:
144 parts = expr.split('|')
145 parts = expr.split('|')
145 val = parts[0]
146 val = parts[0].strip()
146 try:
147 try:
147 filters = [self._filters[f] for f in parts[1:]]
148 filters = [self._filters[f.strip()] for f in parts[1:]]
148 except KeyError, i:
149 except KeyError, i:
149 raise SyntaxError(_("unknown filter '%s'") % i[0])
150 raise SyntaxError(_("unknown filter '%s'") % i[0])
150 parsed.append((self._filter, (filters, val)))
151 parsed.append((self._filter, (filters, val)))
151 else:
152 else:
152 parsed.append((self._get, expr))
153 parsed.append((self._get, expr.strip()))
153
154
154 return parsed
155 return parsed
155
156
General Comments 0
You need to be logged in to leave comments. Login now