dsy пре 1 недеља
родитељ
комит
55b08a53ac

+ 8 - 10
src/components/RichText.vue

@@ -205,7 +205,7 @@ export default {
               const formatName = `paragraphSpacing${config}_em`;
               editor.formatter.register(formatName, {
                 selector: 'p',
-                styles: { 'margin-bottom': config + 'em' },
+                styles: { 'margin-bottom': `${config}em` },
               });
             });
 
@@ -261,7 +261,7 @@ export default {
           // 添加段落间距下拉菜单
           editor.ui.registry.addMenuButton('paragraphSpacing', {
             icon: 'paragraph',
-            //text: '段落间距',
+            // text: '段落间距',
             tooltip: '段落间距',
             fetch: (callback) => {
               const items = [];
@@ -924,9 +924,7 @@ export default {
         }
         if (eleMathArs.length === 0) return;
         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;
       }
     },
@@ -1034,12 +1032,12 @@ export default {
         if (!styles.fontSize && computed.fontSize && computed.fontSize !== 'inherit') {
           const fontSize = computed.fontSize;
           const pxValue = parseFloat(fontSize);
-          if (!isNaN(pxValue)) {
+          if (isNaN(pxValue)) {
+            styles.fontSize = fontSize;
+          } else {
             // px转pt公式:pt = px * 3/4
             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),
         },
-        false
+        false,
       );
       return walker.nextNode();
     },

+ 2 - 2
src/utils/mathjax.js

@@ -4,11 +4,11 @@ window.MathJax = {
   tex: {
     inlineMath: [
       ['$', '$'],
-      ['(', ')'],
+      ['\\(', '\\)'],
     ], // 行内公式选择符
     displayMath: [
       ['$$', '$$'],
-      ['[', ']'],
+      ['\\[', '\\]'],
     ], // 段内公式选择符
     // 增加 physics 宏包
     packages: { '[+]': ['ams', 'physics'] },

+ 1 - 1
src/views/book/courseware/create/components/base/rich_text/RichText.vue

@@ -246,7 +246,7 @@ export default {
     compareAnnotationAndSave(existingIds) {
       this.data.note_list.forEach((annotation) => {
         if (!existingIds.has(annotation.id)) {
-          // 从你的数据存储中移除这个注释
+          // 从数据存储中移除这个注释
           this.selectContentSetMemo(null, annotation.id);
         }
       });

+ 3 - 0
src/views/personal_workbench/edit_task/edit/index.vue

@@ -112,6 +112,7 @@ export default {
         color: '#000000', // 文字颜色
         text_decoration: 'none', // 装饰线样式
         font_style: 'normal', // 字体样式
+        backgroundColor: 'transparent', // 背景颜色
       },
     };
   },
@@ -169,6 +170,7 @@ export default {
       this.format.text_decoration = style.textDecoration || 'none';
       this.format.font_style = style.fontStyle || 'normal';
       this.format.isCopy = true;
+      this.format.backgroundColor = style.backgroundColor || 'transparent';
     },
     // 粘贴格式
     pasteFormat() {
@@ -186,6 +188,7 @@ export default {
           color: this.format.color,
           'text-decoration': this.format.text_decoration,
           'font-style': this.format.font_style,
+          'background-color': this.format.backgroundColor,
         },
       });
       activeEditor.formatter.apply('customFormat');