A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix: tab history display exception
shuai35d99c865648
diff --git a/ui/src/components/DiffContent/index.tsx b/ui/src/components/DiffContent/index.tsxindex d2024a00..2a3b3bd9 100644--- a/ui/src/components/DiffContent/index.tsx+++ b/ui/src/components/DiffContent/index.tsx@@ -93,16 +93,18 @@ const Index: FC<Props> = ({className={classnames('fs-14 font-monospace',newData.original_text && 'mb-4',- )}>- {`/tags/${- newData?.main_tag_slug_name- ? diffText(- newData.main_tag_slug_name,- oldData?.main_tag_slug_name,- )- : diffText(newData.slug_name, oldData?.slug_name)- }`}- </div>+ )}+ dangerouslySetInnerHTML={{+ __html: `/tags/${+ newData?.main_tag_slug_name+ ? diffText(+ newData.main_tag_slug_name,+ oldData?.main_tag_slug_name,+ )+ : diffText(newData.slug_name, oldData?.slug_name)+ }`,+ }}+ />)}<divdangerouslySetInnerHTML={{diff --git a/ui/src/utils/common.ts b/ui/src/utils/common.tsindex ec22ccc3..60570264 100644--- a/ui/src/utils/common.ts+++ b/ui/src/utils/common.ts@@ -179,6 +179,8 @@ function diffText(newText: string, oldText: string): string {?.replace(/<input/gi, '<input');}const diff = Diff.diffChars(oldText, newText);+ console.log(diff);+const result = diff.map((part) => {if (part.added) {if (part.value.replace(/\n/g, '').length <= 0) {