diff --git a/aqt/reviewer.py b/aqt/reviewer.py index f09e8856e..fae03c872 100644 --- a/aqt/reviewer.py +++ b/aqt/reviewer.py @@ -385,6 +385,9 @@ Please run Tools>Empty Cards""") self.web.eval("_getTypedText();") if not self.typeCorrect or not self.typedAnswer: return re.sub(self.typeAnsPat, "", buf) + origSize = len(buf) + buf = buf.replace("
", "") + hadHR = len(buf) != origSize # munge correct value parser = HTMLParser.HTMLParser() cor = stripHTML(self.mw.col.media.strip(self.typeCorrect)) @@ -396,9 +399,14 @@ Please run Tools>Empty Cards""") def repl(match): # can't pass a string in directly, and can't use re.escape as it # escapes too much - return """ + s = """ %s""" % ( self.typeFont, self.typeSize, res) + if hadHR: + # a hack to ensure the q/a separator falls before the answer + # comparison when user is using {{FrontSide}} + s = "
" + s + return s return re.sub(self.typeAnsPat, repl, buf) def _contentForCloze(self, txt, idx):