mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
preserve contextual formatting when wrapping text
https://anki.tenderapp.com/discussions/ankidesktop/37385-cloze-is-stripping-formatting-enlarging-text any formatting inside the selection is removed, but formatting that starts and ends outside the selection will be preserved
This commit is contained in:
parent
5a5be92d09
commit
b1ab681571
1 changed files with 2 additions and 2 deletions
|
@ -276,8 +276,8 @@ function wrap(front, back) {
|
|||
var content = r.cloneContents();
|
||||
var span = document.createElement("span");
|
||||
span.appendChild(content);
|
||||
var new_ = wrappedExceptForWhitespace(span.innerHTML, front, back);
|
||||
setFormat("inserthtml", new_);
|
||||
var new_ = wrappedExceptForWhitespace(span.innerText, front, back);
|
||||
setFormat("inserttext", new_);
|
||||
if (!span.innerHTML) {
|
||||
// run with an empty selection; move cursor back past postfix
|
||||
r = s.getRangeAt(0);
|
||||
|
|
Loading…
Reference in a new issue