mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
fix incorrect marks not showing properly when typing answer
https://anki.tenderapp.com/discussions/ankidesktop/37513-thai-superscripts-not-checked
This commit is contained in:
parent
a2c9b160ca
commit
4f3bd476d5
1 changed files with 9 additions and 0 deletions
|
@ -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 += "<br>↓<br>"
|
||||
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 = "<div><code id=typeans>" + res + "</code></div>"
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue