mirror of https://gitee.com/answerdev/answer.git
Merge branch 'feat/ui-0.5.0' into 'test'
Feat/ui 0.5.0 See merge request opensource/answer!293
This commit is contained in:
commit
57487a9ef8
|
@ -1,5 +1,7 @@
|
|||
import { FC, memo } from 'react';
|
||||
|
||||
import clssnames from 'classnames';
|
||||
|
||||
import { Tag } from '@/components';
|
||||
import { diffText } from '@/utils';
|
||||
|
||||
|
@ -74,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}
|
||||
|
@ -87,7 +89,11 @@ const Index: FC<Props> = ({
|
|||
</div>
|
||||
)}
|
||||
{objectType === 'tag' && opts?.showTagUrlSlug && (
|
||||
<div className="mb-4 fs-14 font-monospace">
|
||||
<div
|
||||
className={clssnames(
|
||||
'fs-14 font-monospace',
|
||||
newData.original_text && 'mb-4',
|
||||
)}>
|
||||
{`/tags/${
|
||||
newData?.main_tag_slug_name
|
||||
? diffText(
|
||||
|
|
|
@ -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, '<iframe')
|
||||
|
|
Loading…
Reference in New Issue