diff --git a/client/web/plugins/com.msgbyte.bbcode/src/tags/BoldTag.tsx b/client/web/plugins/com.msgbyte.bbcode/src/tags/BoldTag.tsx new file mode 100644 index 00000000..e35a8a61 --- /dev/null +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/BoldTag.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import type { TagProps } from '../bbcode/type'; + +export const BoldTag: React.FC = React.memo((props) => { + const { node } = props; + const text = node.content.join(''); + + return {text}; +}); +BoldTag.displayName = 'BoldTag'; 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 7abc5dfb..148bf252 100644 --- a/client/web/plugins/com.msgbyte.bbcode/src/tags/__all__.ts +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/__all__.ts @@ -6,10 +6,12 @@ import { PlainText } from './PlainText'; import { UrlTag } from './UrlTag'; import { EmojiTag } from './EmojiTag'; import { MarkdownTag } from './MarkdownTag'; +import { BoldTag } from './BoldTag'; import './styles.less'; registerBBCodeTag('_text', PlainText); +registerBBCodeTag('b', BoldTag); registerBBCodeTag('url', UrlTag); registerBBCodeTag('img', ImgTag); registerBBCodeTag('code', CodeTag);