From 35d99c86564868e7d5d2a5673aa8a9ba75d16b39 Mon Sep 17 00:00:00 2001 From: shuai Date: Mon, 26 Dec 2022 10:01:04 +0800 Subject: [PATCH] fix: tab history display exception --- ui/src/components/DiffContent/index.tsx | 22 ++++++++++++---------- ui/src/utils/common.ts | 2 ++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ui/src/components/DiffContent/index.tsx b/ui/src/components/DiffContent/index.tsx index d2024a00..2a3b3bd9 100644 --- a/ui/src/components/DiffContent/index.tsx +++ b/ui/src/components/DiffContent/index.tsx @@ -93,16 +93,18 @@ const Index: FC = ({ 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) - }`} - + )} + 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) + }`, + }} + /> )}
{ if (part.added) { if (part.value.replace(/\n/g, '').length <= 0) {