From 340dadac976445691890e7e168050508089daae4 Mon Sep 17 00:00:00 2001 From: leon Date: Wed, 14 Feb 2024 15:29:05 +0800 Subject: [PATCH] Roo/HtmlEditorCore.js --- Roo/HtmlEditorCore.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Roo/HtmlEditorCore.js b/Roo/HtmlEditorCore.js index 3eca682469..313e3b8aa2 100644 --- a/Roo/HtmlEditorCore.js +++ b/Roo/HtmlEditorCore.js @@ -376,7 +376,16 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (this.enableBlocks) { - Roo.htmleditor.Block.initAll(bd); + Array.from(bd.getElementsByTagName('img')).forEach(function(img) { + if (img.closest('figure')) { // assume!! that it's aready + return; + } + var fig = new Roo.htmleditor.BlockFigure({ + image_src : img.src + }); + fig.updateElement(img); // replace it.. + + }); new Roo.htmleditor.FilterBlock({ node : div }); } -- 2.39.2