diff --git a/client/web/plugins/com.msgbyte.bbcode/src/tags/DeleteTag.tsx b/client/web/plugins/com.msgbyte.bbcode/src/tags/DeleteTag.tsx new file mode 100644 index 00000000..2694ce0a --- /dev/null +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/DeleteTag.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import type { TagProps } from '../bbcode/type'; + +export const DeleteTag: React.FC = React.memo((props) => { + const { node } = props; + const text = node.content.join(''); + + return {text}; +}); +DeleteTag.displayName = 'DeleteTag'; diff --git a/client/web/plugins/com.msgbyte.bbcode/src/tags/ItalicTag.tsx b/client/web/plugins/com.msgbyte.bbcode/src/tags/ItalicTag.tsx new file mode 100644 index 00000000..93651ea6 --- /dev/null +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/ItalicTag.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import type { TagProps } from '../bbcode/type'; + +export const ItalicTag: React.FC = React.memo((props) => { + const { node } = props; + const text = node.content.join(''); + + return {text}; +}); +ItalicTag.displayName = 'ItalicTag'; diff --git a/client/web/plugins/com.msgbyte.bbcode/src/tags/UnderlinedTag.tsx b/client/web/plugins/com.msgbyte.bbcode/src/tags/UnderlinedTag.tsx new file mode 100644 index 00000000..4634e6e9 --- /dev/null +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/UnderlinedTag.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import type { TagProps } from '../bbcode/type'; + +export const UnderlinedTag: React.FC = React.memo((props) => { + const { node } = props; + const text = node.content.join(''); + + return {text}; +}); +UnderlinedTag.displayName = 'UnderlinedTag'; 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 148bf252..863723a4 100644 --- a/client/web/plugins/com.msgbyte.bbcode/src/tags/__all__.ts +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/__all__.ts @@ -7,11 +7,17 @@ import { UrlTag } from './UrlTag'; import { EmojiTag } from './EmojiTag'; import { MarkdownTag } from './MarkdownTag'; import { BoldTag } from './BoldTag'; +import { ItalicTag } from './ItalicTag'; +import { UnderlinedTag } from './underlinedTag'; +import { DeleteTag } from './DeleteTag'; import './styles.less'; registerBBCodeTag('_text', PlainText); registerBBCodeTag('b', BoldTag); +registerBBCodeTag('i', ItalicTag); +registerBBCodeTag('u', UnderlinedTag); +registerBBCodeTag('s', DeleteTag); registerBBCodeTag('url', UrlTag); registerBBCodeTag('img', ImgTag); registerBBCodeTag('code', CodeTag);