diff --git a/shared/css/static/frame-chat.scss b/shared/css/static/frame-chat.scss index e79682af..465861de 100644 --- a/shared/css/static/frame-chat.scss +++ b/shared/css/static/frame-chat.scss @@ -1355,5 +1355,30 @@ $client_info_avatar_size: 10em; max-height: 0; } } + + /* special xbbcode formats */ + .container-message .message { + hr { + border: none; + border-top: .125em solid #555; + + margin-top: .1em; + margin-bottom: .1em; + } + + table { + th, td { + border-color: #1e2025; + } + + tr { + background-color: #303036; + } + + tr:nth-child(2n) { + background-color: #25252a; + } + } + } } } diff --git a/shared/js/ui/frames/chat.ts b/shared/js/ui/frames/chat.ts index ded611f2..8a84921b 100644 --- a/shared/js/ui/frames/chat.ts +++ b/shared/js/ui/frames/chat.ts @@ -101,13 +101,16 @@ namespace MessageHelper { "color", "url", "code", - "icode", - "i-code", + "i-code", "icode", "sub", "sup", - "h1", "h2", "h3", + "size", + "hr", "ul", "ol", "list", "li", + + "table", + "tr", "td", "th", /* "img" */ ] //[img]https://i.ytimg.com/vi/kgeSTkZssPg/maxresdefault.jpg[/img] }); diff --git a/shared/js/ui/frames/chat_frame.ts b/shared/js/ui/frames/chat_frame.ts index ed22b37b..0d2f3bc5 100644 --- a/shared/js/ui/frames/chat_frame.ts +++ b/shared/js/ui/frames/chat_frame.ts @@ -624,8 +624,8 @@ test "code": (renderer: Renderer, token: RemarkToken) => "[i-code]" + xbbcode.escape(token.content) + "[/i-code]", "fence": (renderer: Renderer, token: RemarkToken) => "[code" + (token.params ? ("=" + token.params) : "") + "]" + xbbcode.escape(token.content) + "[/code]", - "heading_open": (renderer: Renderer, token: RemarkToken) => "[h" + Math.min(3, token.hLevel) + "]", - "heading_close": (renderer: Renderer, token: RemarkToken) => "[/h" + Math.min(3, token.hLevel) + "]", + "heading_open": (renderer: Renderer, token: RemarkToken) => "[size=" + (9 - Math.min(4, token.hLevel)) + "]", + "heading_close": (renderer: Renderer, token: RemarkToken) => "[/size][hr]", "hr": () => "[hr]",