This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit fdd3b4dbf543c8babbc0f2ce97c3b7cbb3c6a1a4
Author: sy-records <[email protected]>
AuthorDate: Mon Nov 11 15:51:41 2024 +0800

    fix: Tag summary display is not as expected on tag detail page
---
 i18n/en_US.yaml                    |  3 ++-
 i18n/zh_CN.yaml                    |  1 +
 ui/src/pages/Tags/Detail/index.tsx | 34 ++++++++++++++++++++++------------
 3 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml
index 8c3c3ddd..9074c8a1 100644
--- a/i18n/en_US.yaml
+++ b/i18n/en_US.yaml
@@ -1103,6 +1103,7 @@ ui:
     search_placeholder: Filter by tag name
     no_desc: The tag has no description.
     more: More
+    wiki: Wiki
   ask:
     title: Add Question
     edit_title: Edit Question
@@ -1362,7 +1363,7 @@ ui:
     answers: answers
   linked_question:
     title: Linked Questions
-    description: Questions linked to 
+    description: Questions linked to
     no_linked_question: No questions linked from this question.
   invite_to_answer:
     title: Invite People
diff --git a/i18n/zh_CN.yaml b/i18n/zh_CN.yaml
index 3a0d56e8..85581968 100644
--- a/i18n/zh_CN.yaml
+++ b/i18n/zh_CN.yaml
@@ -1086,6 +1086,7 @@ ui:
     search_placeholder: 通过标签名称过滤
     no_desc: 此标签无描述。
     more: 更多
+    wiki: 维基
   ask:
     title: 新增问题
     edit_title: 编辑问题
diff --git a/ui/src/pages/Tags/Detail/index.tsx 
b/ui/src/pages/Tags/Detail/index.tsx
index 33f65414..41b19022 100644
--- a/ui/src/pages/Tags/Detail/index.tsx
+++ b/ui/src/pages/Tags/Detail/index.tsx
@@ -38,7 +38,7 @@ import {
 } from '@/services';
 import QuestionList, { QUESTION_ORDER_KEYS } from '@/components/QuestionList';
 import HotQuestions from '@/components/HotQuestions';
-import { escapeRemove, guard } from '@/utils';
+import { guard } from '@/utils';
 import { pathFactory } from '@/router/pathFactory';
 
 const Index: FC = () => {
@@ -143,12 +143,10 @@ const Index: FC = () => {
               </Link>
             </h3>
 
-            <p className="text-break">
-              {escapeRemove(tagInfo.excerpt) || t('no_desc')}
-              <Link to={pathFactory.tagInfo(curTagName)} className="ms-1">
-                [{t('more')}]
-              </Link>
-            </p>
+            <div
+              className="text-break"
+              dangerouslySetInnerHTML={{ __html: tagInfo.excerpt }}
+            />
 
             <div className="box-ft">
               {tagInfo.is_follower ? (
@@ -156,6 +154,11 @@ const Index: FC = () => {
                   <Button variant="primary" onClick={() => toggleFollow()}>
                     {t('button_following')}
                   </Button>
+                  <Link
+                    to={pathFactory.tagInfo(curTagName)}
+                    className="btn btn-outline-secondary ms-2">
+                    {t('wiki')}
+                  </Link>
                   <Link
                     className="btn btn-outline-secondary ms-2"
                     to="/users/settings/notify">
@@ -163,11 +166,18 @@ const Index: FC = () => {
                   </Link>
                 </div>
               ) : (
-                <Button
-                  variant="outline-primary"
-                  onClick={() => toggleFollow()}>
-                  {t('button_follow')}
-                </Button>
+                <div>
+                  <Button
+                    variant="outline-primary"
+                    onClick={() => toggleFollow()}>
+                    {t('button_follow')}
+                  </Button>
+                  <Link
+                    to={pathFactory.tagInfo(curTagName)}
+                    className="btn btn-outline-secondary ms-2">
+                    {t('wiki')}
+                  </Link>
+                </div>
               )}
             </div>
           </div>

Reply via email to