|
@@ -205,7 +205,7 @@ export default {
|
|
|
const formatName = `paragraphSpacing${config}_em`;
|
|
const formatName = `paragraphSpacing${config}_em`;
|
|
|
editor.formatter.register(formatName, {
|
|
editor.formatter.register(formatName, {
|
|
|
selector: 'p',
|
|
selector: 'p',
|
|
|
- styles: { 'margin-bottom': config + 'em' },
|
|
|
|
|
|
|
+ styles: { 'margin-bottom': `${config}em` },
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -261,7 +261,7 @@ export default {
|
|
|
// 添加段落间距下拉菜单
|
|
// 添加段落间距下拉菜单
|
|
|
editor.ui.registry.addMenuButton('paragraphSpacing', {
|
|
editor.ui.registry.addMenuButton('paragraphSpacing', {
|
|
|
icon: 'paragraph',
|
|
icon: 'paragraph',
|
|
|
- //text: '段落间距',
|
|
|
|
|
|
|
+ // text: '段落间距',
|
|
|
tooltip: '段落间距',
|
|
tooltip: '段落间距',
|
|
|
fetch: (callback) => {
|
|
fetch: (callback) => {
|
|
|
const items = [];
|
|
const items = [];
|
|
@@ -924,9 +924,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
if (eleMathArs.length === 0) return;
|
|
if (eleMathArs.length === 0) return;
|
|
|
await this.$nextTick();
|
|
await this.$nextTick();
|
|
|
- window.MathJax.typesetPromise(eleMathArs).catch((err) =>
|
|
|
|
|
- /* eslint-disable */ console.error(...oo_tx(`483836707_818_65_818_101_11`, 'MathJax error:', err))
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ window.MathJax.typesetPromise(eleMathArs).catch((err) => console.error(err));
|
|
|
this.mathEleIsInit = true;
|
|
this.mathEleIsInit = true;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -1034,12 +1032,12 @@ export default {
|
|
|
if (!styles.fontSize && computed.fontSize && computed.fontSize !== 'inherit') {
|
|
if (!styles.fontSize && computed.fontSize && computed.fontSize !== 'inherit') {
|
|
|
const fontSize = computed.fontSize;
|
|
const fontSize = computed.fontSize;
|
|
|
const pxValue = parseFloat(fontSize);
|
|
const pxValue = parseFloat(fontSize);
|
|
|
- if (!isNaN(pxValue)) {
|
|
|
|
|
|
|
+ if (isNaN(pxValue)) {
|
|
|
|
|
+ styles.fontSize = fontSize;
|
|
|
|
|
+ } else {
|
|
|
// px转pt公式:pt = px * 3/4
|
|
// px转pt公式:pt = px * 3/4
|
|
|
const ptValue = Math.round(pxValue * 0.75 * 10) / 10;
|
|
const ptValue = Math.round(pxValue * 0.75 * 10) / 10;
|
|
|
- styles.fontSize = ptValue + 'pt';
|
|
|
|
|
- } else {
|
|
|
|
|
- styles.fontSize = fontSize;
|
|
|
|
|
|
|
+ styles.fontSize = `${ptValue}pt`;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1076,7 +1074,7 @@ export default {
|
|
|
{
|
|
{
|
|
|
acceptNode: (node) => (node.textContent.trim() ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT),
|
|
acceptNode: (node) => (node.textContent.trim() ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT),
|
|
|
},
|
|
},
|
|
|
- false
|
|
|
|
|
|
|
+ false,
|
|
|
);
|
|
);
|
|
|
return walker.nextNode();
|
|
return walker.nextNode();
|
|
|
},
|
|
},
|