From e1c70fb50c06c612f2429c24d372db5e00bfedb1 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 14 Jan 2022 11:37:28 +0800 Subject: [PATCH] sync --- Roo/htmleditor/BlockFigure.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Roo/htmleditor/BlockFigure.js b/Roo/htmleditor/BlockFigure.js index 648091a0f0..a7fe2f8147 100644 --- a/Roo/htmleditor/BlockFigure.js +++ b/Roo/htmleditor/BlockFigure.js @@ -332,17 +332,23 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { { tag: 'figcaption', - contenteditable : true, + style : { 'text-align': 'left', 'margin-top' : '16px', 'font-size' : '16px', 'line-height' : '24px', - 'font-style': 'italic', - display : this.caption_display + display : this.caption_display }, cls : this.cls.length > 0 ? (this.cls + '-thumbnail' ) : '', - html : this.caption + cn : [ + { + // we can not rely on yahoo syndication to use CSS elements - so have to use '' to encase stuff. + tag : 'i', + contenteditable : true, + html : this.caption + } + ] } ] @@ -361,6 +367,10 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { this.align = this.getVal(node, 'figure', 'align'); this.caption = this.getVal(node, 'figcaption', 'html'); + // remove ' + if (this.caption.trim().match(/^]*>/i)) { + this.caption = this.caption.trim().replace(/^]*>/i, '').replace(/^<\/i>$/i, ''); + } //this.text_align = this.getVal(node, 'figcaption', 'style','text-align'); this.width = this.getVal(node, 'figure', 'style', 'max-width'); //this.margin = this.getVal(node, 'figure', 'style', 'margin'); -- 2.39.2