Skip to content

Commit 6efe1a3

Browse files
authored
fix: table rendering using md-editor (#5371)
Signed-off-by: gaelgoth <[email protected]>
1 parent f031d67 commit 6efe1a3

File tree

4 files changed

+39
-6
lines changed

4 files changed

+39
-6
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@backstage-community/plugin-announcements': patch
3+
---
4+
5+
- Fixed table rendering in `<AnnouncementsPage markdownRenderer="md-editor" />`. Table styling was not correctly applied when using the Backstage Light theme.
6+
- Updated `@uiw/react-md-editor` dependency to `^4.0.8`.

workspaces/announcements/plugins/announcements/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@mui/icons-material": "^5.15.6",
7171
"@mui/material": "^5.15.6",
7272
"@types/react": "^17.0.0 || ^18.0.0",
73-
"@uiw/react-md-editor": "^4.0.7",
73+
"@uiw/react-md-editor": "^4.0.8",
7474
"add": "^2.0.6",
7575
"luxon": "^3.2.0",
7676
"react-use": "^17.2.4",

workspaces/announcements/plugins/announcements/src/components/MarkdownRenderer/MarkdownRenderer.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,33 @@ const useStyles = makeStyles(theme => ({
5353
paddingLeft: theme.spacing(1),
5454
color: theme.palette.text.secondary,
5555
},
56+
'& table': {
57+
'& thead th': {
58+
color: theme.palette.text.primary,
59+
backgroundColor:
60+
theme.palette.type === 'dark'
61+
? theme.palette.background.default
62+
: theme.palette.background.paper,
63+
},
64+
'& th, & td': {
65+
border: 0,
66+
},
67+
'& tbody tr:nth-of-type(odd)': {
68+
backgroundColor:
69+
theme.palette.type === 'dark'
70+
? theme.palette.action.selected
71+
: theme.palette.action.hover,
72+
},
73+
'& tbody tr:nth-of-type(even)': {
74+
backgroundColor:
75+
theme.palette.type === 'dark'
76+
? theme.palette.background.paper
77+
: theme.palette.background.paper,
78+
},
79+
'& tbody td': {
80+
borderTop: `1px solid ${theme.palette.divider}`,
81+
},
82+
},
5683
},
5784
}));
5885

workspaces/announcements/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ __metadata:
17561756
"@testing-library/user-event": "npm:^14.5.1"
17571757
"@types/luxon": "npm:^3.3.3"
17581758
"@types/react": "npm:^17.0.0 || ^18.0.0"
1759-
"@uiw/react-md-editor": "npm:^4.0.7"
1759+
"@uiw/react-md-editor": "npm:^4.0.8"
17601760
add: "npm:^2.0.6"
17611761
cross-fetch: "npm:^3.1.8"
17621762
luxon: "npm:^3.2.0"
@@ -11189,9 +11189,9 @@ __metadata:
1118911189
languageName: node
1119011190
linkType: hard
1119111191

11192-
"@uiw/react-md-editor@npm:^4.0.7":
11193-
version: 4.0.7
11194-
resolution: "@uiw/react-md-editor@npm:4.0.7"
11192+
"@uiw/react-md-editor@npm:^4.0.8":
11193+
version: 4.0.8
11194+
resolution: "@uiw/react-md-editor@npm:4.0.8"
1119511195
dependencies:
1119611196
"@babel/runtime": "npm:^7.14.6"
1119711197
"@uiw/react-markdown-preview": "npm:^5.0.6"
@@ -11200,7 +11200,7 @@ __metadata:
1120011200
peerDependencies:
1120111201
react: ">=16.8.0"
1120211202
react-dom: ">=16.8.0"
11203-
checksum: 10/554fb1efb85ab82870d14924c103d0e21af2a56fcc0dd9b32d40fd9a2e529401600568945ead1177ed6080f826aa886f68c7e1bd560a9145f12b0bd0e880b77f
11203+
checksum: 10/c6a2d7c2c3d843cc7e1dc1e26f01067937a2c7d82073353650ddb125dd05623d1121866d294c3270f48cad05c47fc17c8ccc15303c656104f2814ddb950e4af9
1120411204
languageName: node
1120511205
linkType: hard
1120611206

0 commit comments

Comments
 (0)