diff --git a/aqt/reviewer.py b/aqt/reviewer.py index f01fcbd9f..03b228310 100644 --- a/aqt/reviewer.py +++ b/aqt/reviewer.py @@ -440,12 +440,14 @@ Please run Tools>Empty Cards""") else: res = "" for ok, txt in givenElems: + txt = self._noLoneMarks(txt) if ok: res += good(txt) else: res += bad(txt) res += "

" for ok, txt in correctElems: + txt = self._noLoneMarks(txt) if ok: res += good(txt) else: @@ -453,6 +455,13 @@ Please run Tools>Empty Cards""") res = "
" + res + "
" return res + def _noLoneMarks(self, s): + # ensure a combining character at the start does not join to + # previous text + if s and ucd.category(s[0]).startswith("M"): + return "\xa0" + s + return s + def _getTypedAnswer(self): self.web.evalWithCallback("typeans ? typeans.value : null", self._onTypedAnswer)