From e17dd3f5d46aed6e96ecded33e36072032151722 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Tue, 6 Sep 2022 00:39:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20bbcode=E5=A2=9E=E5=8A=A0markdown?= =?UTF-8?q?=E8=AF=AD=E6=B3=95=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com.msgbyte.bbcode/src/tags/MarkdownTag.tsx | 11 +++++++++++ .../plugins/com.msgbyte.bbcode/src/tags/__all__.ts | 2 ++ client/web/src/plugin/component/index.tsx | 1 + 3 files changed, 14 insertions(+) create mode 100644 client/web/plugins/com.msgbyte.bbcode/src/tags/MarkdownTag.tsx diff --git a/client/web/plugins/com.msgbyte.bbcode/src/tags/MarkdownTag.tsx b/client/web/plugins/com.msgbyte.bbcode/src/tags/MarkdownTag.tsx new file mode 100644 index 00000000..1883e3d9 --- /dev/null +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/MarkdownTag.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { Markdown } from '@capital/component'; +import type { TagProps } from '../bbcode/type'; + +export const MarkdownTag: React.FC = React.memo((props) => { + const { node } = props; + const text = node.content.join(''); + + return ; +}); +MarkdownTag.displayName = 'MarkdownTag'; diff --git a/client/web/plugins/com.msgbyte.bbcode/src/tags/__all__.ts b/client/web/plugins/com.msgbyte.bbcode/src/tags/__all__.ts index 5017451c..7abc5dfb 100644 --- a/client/web/plugins/com.msgbyte.bbcode/src/tags/__all__.ts +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/__all__.ts @@ -5,6 +5,7 @@ import { MentionTag } from './MentionTag'; import { PlainText } from './PlainText'; import { UrlTag } from './UrlTag'; import { EmojiTag } from './EmojiTag'; +import { MarkdownTag } from './MarkdownTag'; import './styles.less'; @@ -14,3 +15,4 @@ registerBBCodeTag('img', ImgTag); registerBBCodeTag('code', CodeTag); registerBBCodeTag('at', MentionTag); registerBBCodeTag('emoji', EmojiTag); +registerBBCodeTag('markdown', MarkdownTag); diff --git a/client/web/src/plugin/component/index.tsx b/client/web/src/plugin/component/index.tsx index f9e89f71..60293832 100644 --- a/client/web/src/plugin/component/index.tsx +++ b/client/web/src/plugin/component/index.tsx @@ -48,3 +48,4 @@ export { Emoji } from '@/components/Emoji'; export { PortalAdd, PortalRemove } from '@/components/Portal'; export { ErrorBoundary } from '@/components/ErrorBoundary'; export { UserName } from '@/components/UserName'; +export { Markdown } from '@/components/Markdown';