Roo/HtmlEditorCore.js
authorAlan <alan@roojs.com>
Thu, 7 Jul 2022 02:27:15 +0000 (10:27 +0800)
committerAlan <alan@roojs.com>
Thu, 7 Jul 2022 02:27:15 +0000 (10:27 +0800)
Roo/HtmlEditorCore.js

index 17c4d62..ac1a257 100644 (file)
@@ -613,13 +613,17 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
             return false;
         }
         
+        
+        
         if (images.length > 0) {
-            // if they mix thse, then it's going to be messy...
-            var imgs = Array.from(d.getElementsByTagName('img'));
-            imgs.concat(Array.from(document.getElementsByTagName('v:imagedata'))); // not sure if we need array from here.
+            // replace all v:imagedata - with img.
+            Roo.each(document.getElementsByTagName('v:imagedata'), function(node) {
+                node.parentNode.insertBefore(node, d.createElement('img'));
+                node.parentNode.removeChild(node);
+            });
             
             
-            Roo.each(imgs, function(img, i) {
+            Roo.each(imgs, function(d.getElementsByTagName('img'), i) {
                 img.setAttribute('src', images[i]);
             });
         }