From 1b12ff6fe5185b5cc12715528d28fbf8d8c21b61 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 20 May 2013 18:21:14 +0900 Subject: [PATCH] add real example to card layout, and move hr like during review --- aqt/clayout.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/aqt/clayout.py b/aqt/clayout.py index 47c2acc87..e49d1128a 100644 --- a/aqt/clayout.py +++ b/aqt/clayout.py @@ -236,11 +236,19 @@ Please create a new card type first.""")) self.playedAudio[c.id] = True def maybeTextInput(self, txt, type='q'): + origLen = len(txt) + txt = txt.replace("
", "") + hadHR = origLen != len(txt) + def answerRepl(match): + res = self.mw.reviewer.correct("exomple", "an example") + if hadHR: + res = "
" + res + return res if type == 'q': - repl = "" + repl = "" + repl = "
%s
" % repl else: - repl = _("(typing comparison appears here)") - repl = "
%s
" % repl + repl = answerRepl return re.sub("\[\[type:.+?\]\]", repl, txt) # Card operations