shmily1213 преди 17 часа
родител
ревизия
0d944b20ba
променени са 1 файла, в които са добавени 47 реда и са изтрити 1 реда
  1. 47 1
      src/composables/useExam.ts

+ 47 - 1
src/composables/useExam.ts

@@ -41,6 +41,8 @@ export const decodeHtmlEntities = (str: string): string => {
     'ntilde': 'ñ',
     'atilde': 'ã',
     'otilde': 'õ',
+    'aelig': 'æ',
+    'eth': 'ð',
     // 其他常用实体
     'quot': '"',
     'apos': "'",
@@ -51,8 +53,27 @@ export const decodeHtmlEntities = (str: string): string => {
     'mdash': '—',
     'ndash': '–',
     'hellip': '…',
+    'darr': '↓',
+    'uarr': '↑',
+    'rarr': '→',
+    'larr': '←',
+    'harr': '↔',
+    'crarr': '↵',
+    'lArr': '⇐',
+    'rArr': '⇒',
+    'hArr': '⇔',
+    'laquo': '«',
+    'raquo': '»',
+    'ldquo': '“',
+    'rdquo': '”',
+    'lsquo': '‘',
+    'rsquo': '’',
+    'lsaquo': '‹',
+    'rsaquo': '›',
     // 数学符号
     'amp': '&',
+    'minus': '−',
+    'plus': '+',
     'times': '×',
     'divide': '÷',
     'plusmn': '±',
@@ -67,12 +88,14 @@ export const decodeHtmlEntities = (str: string): string => {
     'nexists': '∄',
     'notin': '∉',
     'ni': '∋',
+    'empty': '∅',
     'prod': '∏',
     'sum': '∑',
     'prop': '∝',
     'sim': '∼',
     'simeq': '≃',
     'approx': '≈',
+    'asymp': '≈',
     'neq': '≠',
     'equiv': '≡',
     'ne': '≠',
@@ -84,9 +107,13 @@ export const decodeHtmlEntities = (str: string): string => {
     'succ': '≻',
     'preceq': '≼',
     'succeq': '≽',
+    'sub': '⊂',
+    'sube': '⊆',
     'subset': '⊂',
-    'supset': '⊃',
     'subseteq': '⊆',
+    'sup': '⊃',
+    'supe': '⊇',
+    'supset': '⊃',
     'supseteq': '⊇',
     'perp': '⊥',
     'parallel': '∥',
@@ -97,6 +124,7 @@ export const decodeHtmlEntities = (str: string): string => {
     'int': '∫',
     'oint': '∮',
     'angle': '∠',
+    'ang': '∠',
     'mid': '∣',
     'vdash': '⊢',
     'dashv': '⊣',
@@ -104,6 +132,22 @@ export const decodeHtmlEntities = (str: string): string => {
     'vDash': '⊩',
     'Vdash': '⊫',
     'VDash': '⊬',
+    'Oslash': 'Ø',
+    'ordm': 'º',
+    'not': '¬',
+    'prime': '′',
+    // 排版符号
+    'middot': '·',
+    'bull': '•',
+    'sect': '§',
+    'para': '¶',
+    'macr': '¯',
+    'micro': 'µ',
+    // 货币符号
+    'yen': '¥',
+    'euro': '€',
+    'pound': '£',
+    'cent': '¢',
     // 希腊字母
     'alpha': 'α',
     'beta': 'β',
@@ -129,6 +173,7 @@ export const decodeHtmlEntities = (str: string): string => {
     'chi': 'χ',
     'psi': 'ψ',
     'omega': 'ω',
+    'Omega': 'Ω',
     'thetasym': 'ϑ',
     'upsih': 'ϒ',
     'piv': 'ϖ',
@@ -143,6 +188,7 @@ export const decodeHtmlEntities = (str: string): string => {
     .replaceAll(" ", "")
     .replaceAll(" ", "")
     .replaceAll(" ", "")
+    .replaceAll("­", "")
     .replaceAll("​", "");
 
   // 0. 保护真正的 HTML 标签,转义文本中的 < 和 >