comparison markup/template.py @ 184:e27a48802987

Interpolate multiline expressions in templates. Thanks to Christian Boos for reporting the problem and providing the fix.
author cmlenz
date Tue, 22 Aug 2006 13:16:09 +0000
parents 41db0260ebb1
children 8e5a3048b359
comparison
equal deleted inserted replaced
183:35e768b0a58b 184:e27a48802987
823 else: 823 else:
824 stream.append((kind, data, pos)) 824 stream.append((kind, data, pos))
825 825
826 self.stream = stream 826 self.stream = stream
827 827
828 _FULL_EXPR_RE = re.compile(r'(?<!\$)\$\{(.+?)\}') 828 _FULL_EXPR_RE = re.compile(r'(?<!\$)\$\{(.+?)\}', re.DOTALL)
829 _SHORT_EXPR_RE = re.compile(r'(?<!\$)\$([a-zA-Z][a-zA-Z0-9_\.]*)') 829 _SHORT_EXPR_RE = re.compile(r'(?<!\$)\$([a-zA-Z][a-zA-Z0-9_\.]*)')
830 830
831 def _interpolate(cls, text, filename=None, lineno=-1, offset=-1): 831 def _interpolate(cls, text, filename=None, lineno=-1, offset=-1):
832 """Parse the given string and extract expressions. 832 """Parse the given string and extract expressions.
833 833
Copyright (C) 2012-2017 Edgewall Software