Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29,051 changes: 29,051 additions & 0 deletions datahub-web-react/package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions datahub-web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@types/react-router": "^5.1.8",
"@types/react-router-dom": "^5.1.6",
"@uiw/react-md-editor": "^3.3.4",
"@uiw/react-markdown-preview": "^4.1.16",
"@visx/axis": "^3.1.0",
"@visx/curve": "^3.0.0",
"@visx/gradient": "^3.3.0",
Expand Down Expand Up @@ -72,6 +73,7 @@
"history": "^5.0.0",
"html-to-image": "^1.11.11",
"js-cookie": "^2.2.1",
"katex": "^0.16.9",
"moment": "^2.29.4",
"moment-timezone": "^0.5.35",
"monaco-editor": "^0.28.1",
Expand All @@ -95,6 +97,8 @@
"react-window": "^1.8.10",
"reactflow": "^11.10.1",
"reactour": "^1.19.3",
"rehype-katex": "^6.0.3",
"remark-math": "^5.1.1",
"remirror": "^2.0.23",
"styled-components": "^5.2.1",
"turndown-plugin-gfm": "^1.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { Button } from 'antd';
import React, { useEffect, useRef, useState } from 'react';
import styled from 'styled-components';

import { getKatexPlugins } from '@app/shared/markdown/katexConfig';
import 'katex/dist/katex.min.css';

const EditIcon = styled(EditOutlined)`
cursor: pointer;
position: absolute;
Expand Down Expand Up @@ -106,7 +109,7 @@ export default function MarkdownViewer({ source, limit = 150, editable, onEditCl
limit={ignoreLimit ? undefined : `${limit}`}
over={height >= limit && !ignoreLimit ? 'true' : undefined}
>
<MarkdownView ref={ref} source={source} />
<MarkdownView ref={ref as any} source={source} {...(getKatexPlugins() as any)} />
</MarkdownViewContainer>
{height >= limit && !ignoreLimit && (
<CustomButton type="link" onClick={() => setShowAll(!showAll)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import MDEditor from '@uiw/react-md-editor';
import styled from 'styled-components';

import { ANTD_GRAY } from '@app/entity/shared/constants';
import { getKatexPlugins } from '@app/shared/markdown/katexConfig';
import 'katex/dist/katex.min.css';

export default styled(MDEditor)`
const StyledMDEditor = styled(MDEditor)`
height: calc(100% - 46px) !important;
z-index: 0;
box-shadow: none;
Expand Down Expand Up @@ -36,3 +38,9 @@ export default styled(MDEditor)`
height: calc(100% - 46px) !important;
}
`;

StyledMDEditor.defaultProps = {
previewOptions: getKatexPlugins() as any,
};

export default StyledMDEditor;
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import MDEditor from '@uiw/react-md-editor';
import styled from 'styled-components';

import { ANTD_GRAY } from '@app/entityV2/shared/constants';
import { getKatexPlugins } from '@app/shared/markdown/katexConfig';
import 'katex/dist/katex.min.css';

export default styled(MDEditor)`
const StyledMDEditor = styled(MDEditor)`
height: calc(100% - 46px) !important;
z-index: 0;
box-shadow: none;
Expand Down Expand Up @@ -36,3 +38,9 @@ export default styled(MDEditor)`
height: calc(100% - 46px) !important;
}
`;

StyledMDEditor.defaultProps = {
previewOptions: getKatexPlugins() as any,
};

export default StyledMDEditor;
11 changes: 11 additions & 0 deletions datahub-web-react/src/app/shared/markdown/katexConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import rehypeKatex from 'rehype-katex';
import remarkMath from 'remark-math';

/**
* Shared KaTeX configuration for markdown rendering
* Enables LaTeX math support in markdown editors and viewers
*/
export const getKatexPlugins = () => ({
rehypePlugins: [[rehypeKatex, { strict: false }]],
remarkPlugins: [remarkMath],
});
Loading
Loading