mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
if clozing on a word boundary, ensure it's preserved
This commit is contained in:
parent
6af10e4d01
commit
6f8a3c5216
1 changed files with 6 additions and 1 deletions
|
@ -124,7 +124,12 @@ function wrap(front, back) {
|
||||||
span.appendChild(content);
|
span.appendChild(content);
|
||||||
s.removeAllRanges();
|
s.removeAllRanges();
|
||||||
s.addRange(r);
|
s.addRange(r);
|
||||||
setFormat('inserthtml', front + span.innerHTML + back);
|
var new_ = front + span.innerHTML + back;
|
||||||
|
var f = currentField.innerHTML;
|
||||||
|
if (f.length && f[f.length-1] === " ") {
|
||||||
|
new_ = " " + new_;
|
||||||
|
}
|
||||||
|
setFormat('inserthtml', new_);
|
||||||
};
|
};
|
||||||
|
|
||||||
function setFields(fields, focusTo) {
|
function setFields(fields, focusTo) {
|
||||||
|
|
Loading…
Reference in a new issue