Skip to content

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: diffText fucntion change

shuaic4c5f4016a70
diff --git a/ui/src/components/DiffContent/index.tsx b/ui/src/components/DiffContent/index.tsx
index 7f70c760..922e25c1 100644
--- a/ui/src/components/DiffContent/index.tsx
+++ b/ui/src/components/DiffContent/index.tsx
@@ -76,7 +76,7 @@ const Index: FC<Props> = ({
)}
{objectType === 'question' && (
<div className="mb-4">
- {tag.map((item) => {
+ {tag?.map((item) => {
return (
<Tag
key={item.slug_name}
diff --git a/ui/src/utils/common.ts b/ui/src/utils/common.ts
index 9b2eee69..1b8ac340 100644
--- a/ui/src/utils/common.ts
+++ b/ui/src/utils/common.ts
@@ -170,7 +170,7 @@ function diffText(newText: string, oldText: string): string {
return '';
}
- if (!oldText) {
+ if (typeof oldText !== 'string') {
return newText
?.replace(/\n/gi, '<br>')
?.replace(/<iframe/gi, '&lt;iframe')