Skip to content

Commit a323cc9

Browse files
committed
Execute js when using immediateWrites
1 parent 5137df6 commit a323cc9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

writeCapture.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,15 @@
303303
}
304304
function immediateWrite(s) {
305305
var target = $.$(context.target);
306-
target.parentNode.innerHTML += s;
306+
var div = doc.createElement('div');
307+
target.parentNode.insertBefore(div,target);
308+
$.replaceWith(div,sanitize(s));
307309
}
308310
function immediateWriteln(s) {
309311
var target = $.$(context.target);
310-
target.parentNode.innerHTML += s + '\n';
312+
var div = doc.createElement('div');
313+
target.parentNode.insertBefore(div,target);
314+
$.replaceWith(div,sanitize(s) + '\n');
311315
}
312316
function makeTemp(id) {
313317
var t = doc.createElement('div');

0 commit comments

Comments
 (0)