Skip to content

Commit c33dbd2

Browse files
committed
fix: #252 disable support custom style in markdown render
1 parent 5cc71d0 commit c33dbd2

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

client/shared/i18n/langs/en-US/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
"k5be1a5b0": "Delete role group",
135135
"k5bec387": "Unable to get group information",
136136
"k5ce4e16d": "Clear",
137+
"k5d1e4cd8": "Custom styles are not supported",
137138
"k5d2a6631": "Allow to manage channels",
138139
"k5f91e72c": "Built Plugins",
139140
"k5fc9ccb6": "Operation too frequently",

client/shared/i18n/langs/zh-CN/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
"k5be1a5b0": "删除身份组",
135135
"k5bec387": "无法获取到群组信息",
136136
"k5ce4e16d": "清除",
137+
"k5d1e4cd8": "不支持自定义样式",
137138
"k5d2a6631": "允许管理频道",
138139
"k5f91e72c": "内置插件",
139140
"k5fc9ccb6": "操作过于频繁",

client/web/src/components/Markdown/render.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.tailchat-markdown {
2+
min-height: 24px;
3+
24
* {
35
user-select: text;
46
}

client/web/src/components/Markdown/render.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { makeAbsoluteUrl } from '@/utils/url-helper';
22
import React, { useCallback, useMemo } from 'react';
3-
import { isValidStr, parseUrlStr } from 'tailchat-shared';
3+
import { isValidStr, parseUrlStr, useTranslation } from 'tailchat-shared';
44
import { Loadable } from '../Loadable';
55
import { Image } from 'tailchat-design';
66
import remarkGfm from 'remark-gfm';
@@ -15,6 +15,7 @@ export const Markdown: React.FC<{
1515
raw: string;
1616
baseUrl?: string;
1717
}> = React.memo(({ raw, baseUrl }) => {
18+
const { t } = useTranslation();
1819
const transformUrl = useCallback(
1920
(url: string) => {
2021
url = parseUrlStr(url);
@@ -43,6 +44,7 @@ export const Markdown: React.FC<{
4344
preview={true}
4445
/>
4546
),
47+
style: () => <div>{t('不支持自定义样式')}</div>,
4648
}),
4749
[]
4850
);

0 commit comments

Comments
 (0)