mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12: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:
|
else:
|
||||||
res = ""
|
res = ""
|
||||||
for ok, txt in givenElems:
|
for ok, txt in givenElems:
|
||||||
|
txt = self._noLoneMarks(txt)
|
||||||
if ok:
|
if ok:
|
||||||
res += good(txt)
|
res += good(txt)
|
||||||
else:
|
else:
|
||||||
res += bad(txt)
|
res += bad(txt)
|
||||||
res += "<br>↓<br>"
|
res += "<br>↓<br>"
|
||||||
for ok, txt in correctElems:
|
for ok, txt in correctElems:
|
||||||
|
txt = self._noLoneMarks(txt)
|
||||||
if ok:
|
if ok:
|
||||||
res += good(txt)
|
res += good(txt)
|
||||||
else:
|
else:
|
||||||
|
@ -453,6 +455,13 @@ Please run Tools>Empty Cards""")
|
||||||
res = "<div><code id=typeans>" + res + "</code></div>"
|
res = "<div><code id=typeans>" + res + "</code></div>"
|
||||||
return 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):
|
def _getTypedAnswer(self):
|
||||||
self.web.evalWithCallback("typeans ? typeans.value : null", self._onTypedAnswer)
|
self.web.evalWithCallback("typeans ? typeans.value : null", self._onTypedAnswer)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue