|
|
@@ -615,6 +615,7 @@ export default {
|
|
|
}
|
|
|
editor.fire('change');
|
|
|
editor.nodeChanged();
|
|
|
+ this.setPinYinStyleForTitle();
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -785,6 +786,15 @@ export default {
|
|
|
}
|
|
|
editor.fire('change');
|
|
|
editor.nodeChanged();
|
|
|
+ this.setPinYinStyleForTitle();
|
|
|
+ },
|
|
|
+ //标题类型的富文本,如果开启了拼音,需要同步拼音样式
|
|
|
+ setPinYinStyleForTitle() {
|
|
|
+ if (this.isViewPinyin) {
|
|
|
+ let styles = this.getFirstCharStyles();
|
|
|
+ this.$emit('createParsedTextStyleForTitle', styles);
|
|
|
+ return;
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -967,17 +977,20 @@ export default {
|
|
|
replaceSpanString(str) {
|
|
|
return str.replace(/<span\b[^>]*>(.*?)<\/span>/gi, '$1');
|
|
|
},
|
|
|
- createParsedTextInfoPinyin(content) {
|
|
|
- let styles = this.getFirstCharStyles();
|
|
|
- let text = content.replace(/<[^>]+>/g, '');
|
|
|
- this.$emit('createParsedTextInfoPinyin', text, styles);
|
|
|
- },
|
|
|
+ // createParsedTextInfoPinyin(content) {
|
|
|
+ // let styles = this.getFirstCharStyles();
|
|
|
+ // let text = content.replace(/<[^>]+>/g, '');
|
|
|
+ // this.$emit('createParsedTextInfoPinyin', text, styles);
|
|
|
+ // },
|
|
|
handleRichTextBlur() {
|
|
|
this.$emit('handleRichTextBlur', this.itemIndex);
|
|
|
let content = tinymce.get(this.id).getContent();
|
|
|
|
|
|
if (this.isViewPinyin) {
|
|
|
- this.createParsedTextInfoPinyin(content);
|
|
|
+ // this.createParsedTextInfoPinyin(content);
|
|
|
+ let styles = this.getFirstCharStyles();
|
|
|
+ let text = content.replace(/<[^>]+>/g, '');
|
|
|
+ this.$emit('createParsedTextInfoPinyin', text, styles);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -1203,9 +1216,12 @@ export default {
|
|
|
styles.color = computed.color;
|
|
|
}
|
|
|
|
|
|
- if (!styles.bold && (computed.fontWeight === 'bold' || computed.fontWeight === '700')) {
|
|
|
+ if (!styles.bold && (computed.fontWeight === 'bold' || computed.fontWeight >= '700')) {
|
|
|
styles.bold = true;
|
|
|
styles.fontWeight = 'bold';
|
|
|
+ } else {
|
|
|
+ styles.bold = false;
|
|
|
+ styles.fontWeight = '';
|
|
|
}
|
|
|
|
|
|
if (!styles.underline && computed.textDecoration.includes('underline')) {
|
|
|
@@ -1232,7 +1248,7 @@ export default {
|
|
|
{
|
|
|
acceptNode: (node) => (node.textContent.trim() ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT),
|
|
|
},
|
|
|
- false,
|
|
|
+ false
|
|
|
);
|
|
|
return walker.nextNode();
|
|
|
},
|