From 50e6fade55ae3eb1024b67314c5e6d81f557ca03 Mon Sep 17 00:00:00 2001 From: Aaron Harsh Date: Sun, 29 Jan 2012 19:34:50 -0800 Subject: [PATCH] Make undoing a cloze operation behave more intuitively Prior to this change, undoing the clozeing of a block of text would delete the text altogether. We'd prefer it to revert to unclozed text. --- aqt/editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index 2dd33f49e..dcfa99e7c 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -127,7 +127,7 @@ function wrap(front, back) { setFormat('removeFormat', null, true); var s = window.getSelection(); var r = s.getRangeAt(0); - var content = r.extractContents(); + var content = r.cloneContents(); var span = document.createElement("span") span.appendChild(content); s.removeAllRanges();