2
0
Эх сурвалжийг харах

:bug: meaning 里面不能有 [] {}

visuddhinanda 2 жил өмнө
parent
commit
63850c0796

+ 11 - 1
dashboard/src/components/template/Wbw/RelaGraphic.tsx

@@ -23,7 +23,17 @@ const RelaGraphicWidget = ({ wbwData }: IWidget) => {
             const localName = terms?.find(
             const localName = terms?.find(
               (item) => item.word === relation.relation
               (item) => item.word === relation.relation
             )?.meaning;
             )?.meaning;
-            return `${relation.sour_id}(${relation.sour_spell}<br />${item.meaning?.value}) --"${relation.relation}<br />${localName}"--> ${relation.dest_id}(${relation.dest_spell})\n`;
+            return `${relation.sour_id}(${
+              relation.sour_spell
+            }<br />${item.meaning?.value
+              ?.replaceAll("[", "")
+              .replaceAll("]", "")
+              .replaceAll("{", "")
+              .replaceAll("}", "")}) --"${
+              relation.relation
+            }<br />${localName}"--> ${relation.dest_id}(${
+              relation.dest_spell
+            })\n`;
           });
           });
           return graphic.join("");
           return graphic.join("");
         } else {
         } else {