mirror of
https://github.com/ankitects/anki.git
synced 2026-01-09 12:03:56 -05:00
Fix: Close typed not on new line
This commit is contained in:
parent
65954cb2a5
commit
0af6b4d2ef
1 changed files with 5 additions and 3 deletions
|
|
@ -146,16 +146,18 @@ export class ReviewerState {
|
||||||
}
|
}
|
||||||
|
|
||||||
async showTypedAnswer(html: string) {
|
async showTypedAnswer(html: string) {
|
||||||
console.log({ data: this._cardData });
|
|
||||||
if (this._cardData?.typedAnswer === undefined) {
|
if (this._cardData?.typedAnswer === undefined) {
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
const args = this._cardData.typedAnswer.args;
|
||||||
const compareAnswerResp = await compareAnswer({
|
const compareAnswerResp = await compareAnswer({
|
||||||
expected: this._cardData.typedAnswer.text,
|
expected: this._cardData.typedAnswer.text,
|
||||||
provided: this.currentTypedAnswer,
|
provided: this.currentTypedAnswer,
|
||||||
combining: !this._cardData.typedAnswer.args.includes("nc"),
|
combining: !args.includes("nc"),
|
||||||
});
|
});
|
||||||
const display = compareAnswerResp.val;
|
|
||||||
|
const prefix = args.includes("cloze") ? "<br/>" : "";
|
||||||
|
const display = prefix + compareAnswerResp.val;
|
||||||
|
|
||||||
return html.replace(typedAnswerRegex, display);
|
return html.replace(typedAnswerRegex, display);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue