From f0909ebed2c581a7ff2521f89f5349a59d5ae7a2 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 17 Apr 2011 06:32:49 +0900 Subject: [PATCH] if context is off, don't lose outer field styling --- anki/template/template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/anki/template/template.py b/anki/template/template.py index e70b181f4..7dc157dd9 100644 --- a/anki/template/template.py +++ b/anki/template/template.py @@ -186,7 +186,9 @@ class Template(object): # just the answers ans = re.findall(reg%ord, txt) ans = [""+a[0]+"" for a in ans] - return ", ".join(ans) + ans = ", ".join(ans) + # but we want to preserve the outer field styling + return re.sub("(^)(.*)", "\\1"+ans+"", txt) # and display other clozes normally return re.sub(reg%".*?", "\\1", txt)