fix: #252 disable support custom style in markdown render

chore/cli-prune-script
moonrailgun 8 months ago
parent 5cc71d0235
commit c33dbd241c

@ -134,6 +134,7 @@
"k5be1a5b0": "Delete role group", "k5be1a5b0": "Delete role group",
"k5bec387": "Unable to get group information", "k5bec387": "Unable to get group information",
"k5ce4e16d": "Clear", "k5ce4e16d": "Clear",
"k5d1e4cd8": "Custom styles are not supported",
"k5d2a6631": "Allow to manage channels", "k5d2a6631": "Allow to manage channels",
"k5f91e72c": "Built Plugins", "k5f91e72c": "Built Plugins",
"k5fc9ccb6": "Operation too frequently", "k5fc9ccb6": "Operation too frequently",

@ -134,6 +134,7 @@
"k5be1a5b0": "删除身份组", "k5be1a5b0": "删除身份组",
"k5bec387": "无法获取到群组信息", "k5bec387": "无法获取到群组信息",
"k5ce4e16d": "清除", "k5ce4e16d": "清除",
"k5d1e4cd8": "不支持自定义样式",
"k5d2a6631": "允许管理频道", "k5d2a6631": "允许管理频道",
"k5f91e72c": "内置插件", "k5f91e72c": "内置插件",
"k5fc9ccb6": "操作过于频繁", "k5fc9ccb6": "操作过于频繁",

@ -1,4 +1,6 @@
.tailchat-markdown { .tailchat-markdown {
min-height: 24px;
* { * {
user-select: text; user-select: text;
} }

@ -1,6 +1,6 @@
import { makeAbsoluteUrl } from '@/utils/url-helper'; import { makeAbsoluteUrl } from '@/utils/url-helper';
import React, { useCallback, useMemo } from 'react'; import React, { useCallback, useMemo } from 'react';
import { isValidStr, parseUrlStr } from 'tailchat-shared'; import { isValidStr, parseUrlStr, useTranslation } from 'tailchat-shared';
import { Loadable } from '../Loadable'; import { Loadable } from '../Loadable';
import { Image } from 'tailchat-design'; import { Image } from 'tailchat-design';
import remarkGfm from 'remark-gfm'; import remarkGfm from 'remark-gfm';
@ -15,6 +15,7 @@ export const Markdown: React.FC<{
raw: string; raw: string;
baseUrl?: string; baseUrl?: string;
}> = React.memo(({ raw, baseUrl }) => { }> = React.memo(({ raw, baseUrl }) => {
const { t } = useTranslation();
const transformUrl = useCallback( const transformUrl = useCallback(
(url: string) => { (url: string) => {
url = parseUrlStr(url); url = parseUrlStr(url);
@ -43,6 +44,7 @@ export const Markdown: React.FC<{
preview={true} preview={true}
/> />
), ),
style: () => <div>{t('不支持自定义样式')}</div>,
}), }),
[] []
); );

Loading…
Cancel
Save