diff --git a/src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-inlinecustomtag-update.js b/src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-inlinecustomtag-update.js index 9ff2acd9a3..d057c63fcb 100644 --- a/src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-inlinecustomtag-update.js +++ b/src/bundle/Resources/public/js/alloyeditor/src/buttons/ez-btn-inlinecustomtag-update.js @@ -24,8 +24,12 @@ export default class EzBtnInlineCustomTagUpdate extends EzBtnCustomTagUpdate { widget.setFocused(true); if (createNewTag) { + const firstChild = selection.getFirst(); + const isNodeElement = firstChild.type === CKEDITOR.NODE_ELEMENT; + const content = isNodeElement && firstChild.is('table') ? selection.$.textContent : selection.getHtml(); + widget.setName(this.customTagName); - widget.setWidgetContent(selection.getHtml()); + widget.setWidgetContent(content); widget.renderIcon(); }