Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish Markdown component #1477

Merged
merged 40 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
609fcb1
Review: Markdown
bharatkashyap Dec 20, 2022
5c07163
Merge branch 'master' into polish-markdown
bharatkashyap Dec 20, 2022
3ba3f43
Merge branch 'master' into polish-markdown
bharatkashyap Dec 20, 2022
3f10e3b
Review: Olivier
bharatkashyap Dec 22, 2022
23e0663
Merge branch 'master' into polish-markdown
bharatkashyap Dec 22, 2022
de1e1d2
Merge branch 'master' of github.com:mui/mui-toolpad into polish-markdown
bharatkashyap Jan 3, 2023
1d076c9
Fix: prettier
bharatkashyap Jan 3, 2023
1d3e92e
Fix: Namespace IDs
bharatkashyap Jan 3, 2023
fd659cf
Merge branch 'master' into polish-markdown
bharatkashyap Jan 4, 2023
3477f91
Fix: Review Jan 1
bharatkashyap Jan 5, 2023
16d7605
Merge branch 'master' into polish-markdown
bharatkashyap Jan 5, 2023
e5fd9c9
Use scroll for code overflow instead of wrap
bharatkashyap Jan 5, 2023
debfd9b
Merge branch 'polish-markdown' of github.com:mui/mui-toolpad into pol…
bharatkashyap Jan 5, 2023
e2089ca
Merge branch 'master' into polish-markdown
bharatkashyap Jan 5, 2023
efb27bb
Merge branch 'master' into polish-markdown
bharatkashyap Jan 6, 2023
66acedb
Merge branch 'master' of github.com:mui/mui-toolpad into polish-markdown
bharatkashyap Jan 6, 2023
47f8d1a
Update packages/toolpad-components/src/Text.tsx
bharatkashyap Jan 9, 2023
bf918a9
Update packages/toolpad-components/src/Text.tsx
bharatkashyap Jan 9, 2023
0aa9ae3
Merge branch 'master' of github.com:mui/mui-toolpad into polish-markdown
bharatkashyap Jan 9, 2023
864544a
Merge branch 'master' of github.com:mui/mui-toolpad into polish-markdown
bharatkashyap Jan 18, 2023
5b60673
Fix: Remove margins on markdown paragraphs
bharatkashyap Jan 18, 2023
6c7c74f
Fix: prettier
bharatkashyap Jan 19, 2023
0b78cb5
Merge branch 'master' of github.com:mui/mui-toolpad into polish-markdown
bharatkashyap Jan 19, 2023
79d741f
Fix: prettier
bharatkashyap Jan 19, 2023
f420e2f
Merge branch 'master' into polish-markdown
bharatkashyap Jan 31, 2023
9c42d77
Merge fix
bharatkashyap Jan 31, 2023
0c89ee2
Merge branch 'master' of github.com:mui/mui-toolpad into polish-markdown
bharatkashyap Feb 14, 2023
6a8c5b1
Fix: prettier
bharatkashyap Feb 14, 2023
d1c5486
Fix: Images template sub-breed select
bharatkashyap Feb 14, 2023
cbe99e3
Ignore Firefox-specific error
bharatkashyap Feb 14, 2023
79c9758
Merge branch 'master' of github.com:mui/mui-toolpad into polish-markdown
bharatkashyap Feb 16, 2023
9afd935
Merge branch 'master' into polish-markdown
Janpot Feb 16, 2023
ae54b5d
Merge branch 'master' into polish-markdown
bharatkashyap Feb 16, 2023
6fdf2f0
No need for `fill-available`
bharatkashyap Feb 17, 2023
77a2a8b
Merge branch 'master' of github.com:mui/mui-toolpad into polish-markdown
bharatkashyap Feb 17, 2023
19c9ea7
Merge branch 'master' into polish-markdown
bharatkashyap Feb 17, 2023
6dda85c
Merge branch 'polish-markdown' of github.com:mui/mui-toolpad into pol…
bharatkashyap Feb 17, 2023
9aca466
Merge branch 'polish-markdown' of github.com:mui/mui-toolpad into pol…
bharatkashyap Feb 17, 2023
9fa3237
Fix: Rule already exists
bharatkashyap Feb 17, 2023
fef0c46
Merge branch 'master' of github.com:mui/mui-toolpad into polish-markdown
bharatkashyap Feb 20, 2023
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
1 change: 0 additions & 1 deletion packages/toolpad-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"react-is": "^18.2.0",
"react-router-dom": "^6.3.0",
"react-split-pane": "^0.1.92",
"remark-gfm": "^3.0.1",
"serialize-javascript": "^6.0.0",
"ses": "^0.18.0",
"sucrase": "^3.29.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/toolpad-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@mui/material": "^5.11.0",
"@mui/toolpad-core": "^0.0.31",
"@mui/x-data-grid-pro": "^5.17.16",
"react-markdown": "^8.0.4"
"markdown-to-jsx": "^7.1.8"
},
"devDependencies": {
"react": "^18.2.0"
Expand Down
19 changes: 16 additions & 3 deletions packages/toolpad-components/src/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import {
styled,
} from '@mui/material';
import { createComponent } from '@mui/toolpad-core';
import remarkGfm from 'remark-gfm';

const ReactMarkdown = React.lazy(() => import('react-markdown'));
const ReactMarkdown = React.lazy(() => import('markdown-to-jsx'));
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved

type BaseProps = MuiLinkProps | MuiTypographyProps;
interface TextProps extends Omit<BaseProps, 'children'> {
Expand All @@ -34,7 +33,21 @@ function Text({ value, markdown, href, loading, mode, sx, ...rest }: TextProps)
) : (
<MarkdownContainer>
<React.Suspense>
<ReactMarkdown remarkPlugins={[remarkGfm]}>{value}</ReactMarkdown>
<ReactMarkdown
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved
options={{
overrides: {
a: {
component: MuiLink,
props: {
target: '_blank',
rel: 'noopener noreferrer nofollow',
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved
},
},
},
}}
>
{value}
</ReactMarkdown>
</React.Suspense>
</MarkdownContainer>
);
Expand Down
Loading