asdsad
This commit is contained in:
@@ -1 +1 @@
|
||||
1.1.78
|
||||
1.1.79
|
||||
@@ -484,7 +484,6 @@
|
||||
}
|
||||
if (component && component.view && component.view.el) {
|
||||
const viewEl = component.view.el;
|
||||
const hasInline = /<span\b|style\s*=/i.test(htmlSource);
|
||||
const inlineComputedStyles = (sourceEl) => {
|
||||
try {
|
||||
const docRef = sourceEl.ownerDocument || document;
|
||||
@@ -532,38 +531,36 @@
|
||||
return '';
|
||||
}
|
||||
};
|
||||
if (!hasInline) {
|
||||
const inlined = inlineComputedStyles(viewEl);
|
||||
if (inlined) {
|
||||
htmlSource = inlined;
|
||||
} else {
|
||||
try {
|
||||
const cs = (viewEl.ownerDocument || document).defaultView.getComputedStyle(viewEl);
|
||||
const styles = [];
|
||||
const pushStyle = (prop, val) => {
|
||||
if (val) styles.push(`${prop}:${val}`);
|
||||
};
|
||||
pushStyle('font-family', cs.fontFamily);
|
||||
pushStyle('font-size', cs.fontSize);
|
||||
pushStyle('font-weight', cs.fontWeight);
|
||||
pushStyle('font-style', cs.fontStyle);
|
||||
if (cs.textDecorationLine && cs.textDecorationLine !== 'none') {
|
||||
pushStyle('text-decoration', cs.textDecorationLine);
|
||||
}
|
||||
if (cs.textAlign && cs.textAlign !== 'start') {
|
||||
pushStyle('text-align', cs.textAlign);
|
||||
}
|
||||
if (cs.lineHeight && cs.lineHeight !== 'normal') {
|
||||
pushStyle('line-height', cs.lineHeight);
|
||||
}
|
||||
if (cs.color) {
|
||||
pushStyle('color', cs.color);
|
||||
}
|
||||
if (styles.length) {
|
||||
htmlSource = `<span style="${styles.join(';')}">${htmlSource}</span>`;
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
const inlined = inlineComputedStyles(viewEl);
|
||||
if (inlined) {
|
||||
htmlSource = inlined;
|
||||
} else {
|
||||
try {
|
||||
const cs = (viewEl.ownerDocument || document).defaultView.getComputedStyle(viewEl);
|
||||
const styles = [];
|
||||
const pushStyle = (prop, val) => {
|
||||
if (val) styles.push(`${prop}:${val}`);
|
||||
};
|
||||
pushStyle('font-family', cs.fontFamily);
|
||||
pushStyle('font-size', cs.fontSize);
|
||||
pushStyle('font-weight', cs.fontWeight);
|
||||
pushStyle('font-style', cs.fontStyle);
|
||||
if (cs.textDecorationLine && cs.textDecorationLine !== 'none') {
|
||||
pushStyle('text-decoration', cs.textDecorationLine);
|
||||
}
|
||||
if (cs.textAlign && cs.textAlign !== 'start') {
|
||||
pushStyle('text-align', cs.textAlign);
|
||||
}
|
||||
if (cs.lineHeight && cs.lineHeight !== 'normal') {
|
||||
pushStyle('line-height', cs.lineHeight);
|
||||
}
|
||||
if (cs.color) {
|
||||
pushStyle('color', cs.color);
|
||||
}
|
||||
if (styles.length) {
|
||||
htmlSource = `<span style="${styles.join(';')}">${htmlSource}</span>`;
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
const initialHtml = this.sanitizeInlineHtml(htmlSource, modelContent || '');
|
||||
|
||||
Reference in New Issue
Block a user