Skip to content

Commit

Permalink
version fix: 2.44.7
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 committed Apr 9, 2023
1 parent 64da814 commit fccf99c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions dist/suneditor.min.js

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -5345,27 +5345,15 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re

// figure
if (util.isFigures(tagName)) {
let w = '', h = '';
const sv = m.match(/style\s*=\s*(?:"|')[^"']*(?:"|')/);
if (!v) v = [];
if (sv) {
const wsize = sv[0].match(/width\s?:\s?(\d+)(px|%)/);
const hsize = sv[0].match(/height\s?:\s?(\d+)(px|%)/);
const w_ = wsize && wsize[1] && wsize[2] ? wsize[1] + wsize[2] : 'auto';
const h_ = hsize && hsize[1] && hsize[2] ? hsize[1] + hsize[2] : 'auto';
w = util.getNumber(w_, -1) || '';
h = util.getNumber(h_, -1) || '';
v.push('style="width:'+ w_ + '; height:'+ h_ + ';"');
}

if (!w || !h) {
const avw = m.match(/width\s*=\s*((?:"|')[^"']*(?:"|'))/);
const avh = m.match(/height\s*=\s*((?:"|')[^"']*(?:"|'))/);
if (avw || avh) {
w = !w ? util.getNumber(avw ? avw[1] : '') || '' : w;
h = !h ? util.getNumber(avh ? avh[1] : '') || '' : h;
}
}
}

if (v) {
Expand Down

0 comments on commit fccf99c

Please sign in to comment.