From 425789535f11a47168a641d0adbea9947f49ff36 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 20 Dec 2010 00:37:16 +0900 Subject: [PATCH] don't trim whitespace in sections --- anki/template/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anki/template/template.py b/anki/template/template.py index a717e3ba9..d687270a8 100644 --- a/anki/template/template.py +++ b/anki/template/template.py @@ -63,7 +63,7 @@ class Template(object): """Compiles our section and tag regular expressions.""" tags = { 'otag': re.escape(self.otag), 'ctag': re.escape(self.ctag) } - section = r"%(otag)s[\#|^]([^\}]*)%(ctag)s\s*(.+?)\s*%(otag)s/\1%(ctag)s" + section = r"%(otag)s[\#|^]([^\}]*)%(ctag)s(.+?)%(otag)s/\1%(ctag)s" self.section_re = re.compile(section % tags, re.M|re.S) tag = r"%(otag)s(#|=|&|!|>|\{)?(.+?)\1?%(ctag)s+"