Skip to content

Commit c43829c

Browse files
fix: katex breaking the app (#6710)
* fix: katex breaking the app * feat: katex storybook * fix: unit test * chore: changed fork link * fix: yarn.lock
1 parent d9a60eb commit c43829c

File tree

5 files changed

+1372
-20
lines changed

5 files changed

+1372
-20
lines changed

app/containers/message/Message.stories.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,3 +2031,42 @@ const attachmentWithTextAndLink = [
20312031
export const AttachmentWithTextAndLink = () => <Message attachments={attachmentWithTextAndLink} />;
20322032

20332033
export const AttachmentWithTextAndLinkLargeFont = () => <MessageLargeFont attachments={attachmentWithTextAndLink} />;
2034+
const katex = {
2035+
msg: '\\[ \\color{black} \\colorbox{white}{ \\boxed{ \\begin{matrix} \\;\\;\\;\\; \\overlinesegment {\\underlinesegment{ \\Huge Test\\; Test \\; in \\; Test} } & \\\\ \\;\\;\\textit{develop}\\end{matrix} } }\\]',
2036+
md: [
2037+
{
2038+
type: 'KATEX',
2039+
value:
2040+
' \\color{black} \\colorbox{white}{ \\boxed{ \\begin{matrix} \\;\\;\\;\\; \\overlinesegment {\\underlinesegment{ \\Huge Test\\; Test \\; in \\; Test} } & \\\\ \\;\\;\\textit{develop}\\end{matrix} } }'
2041+
}
2042+
]
2043+
};
2044+
2045+
export const Katex = () => (
2046+
<>
2047+
<Message {...katex} />
2048+
</>
2049+
);
2050+
export const KatexLargeFont = () => <MessageLargeFont {...katex} />;
2051+
2052+
const inlineKatex = {
2053+
msg: '\\(xˆ2 + yˆ2 - zˆ2\\)',
2054+
md: [
2055+
{
2056+
type: 'PARAGRAPH',
2057+
value: [
2058+
{
2059+
type: 'INLINE_KATEX',
2060+
value: 'xˆ2 + yˆ2 - zˆ2'
2061+
}
2062+
]
2063+
}
2064+
]
2065+
};
2066+
2067+
export const InlineKatex = () => (
2068+
<>
2069+
<Message {...inlineKatex} />
2070+
</>
2071+
);
2072+
export const InlineKatexLargeFont = () => <MessageLargeFont {...inlineKatex} />;

0 commit comments

Comments
 (0)