Skip to content

Commit 0493c5c

Browse files
authored
fix(app): specify component for markdown uls (#14997)
When these are undefined, if react-markdown tries to render them it will throw and that will crash the app. With these implemented with the same StyledText passthrough as other text elements, it won't crash anymore - though our styling rules aren't applied to the actual text in the ul. Closes RQA-2566 Closes RQA-2587
1 parent 972c970 commit 0493c5c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

app/src/molecules/ReleaseNotes/index.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ export function ReleaseNotes(props: ReleaseNotesProps): JSX.Element {
2020
<Markdown
2121
components={{
2222
div: undefined,
23-
ul: undefined,
23+
ul: UnnumberedListText,
2424
h2: HeaderText,
25-
li: ParagraphText,
25+
li: ListItemText,
2626
p: ParagraphText,
2727
a: ExternalLink,
2828
}}
@@ -47,3 +47,11 @@ function ParagraphText(props: JSX.IntrinsicAttributes): JSX.Element {
4747
function HeaderText(props: JSX.IntrinsicAttributes): JSX.Element {
4848
return <StyledText {...props} as="h3" />
4949
}
50+
51+
function ListItemText(props: JSX.IntrinsicAttributes): JSX.Element {
52+
return <StyledText {...props} as="li" />
53+
}
54+
55+
function UnnumberedListText(props: JSX.IntrinsicAttributes): JSX.Element {
56+
return <StyledText {...props} as="ul" />
57+
}

app/src/molecules/modals/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@
7373
max-height: 100%;
7474
overflow-y: auto;
7575
padding-bottom: 3rem;
76-
}
76+
}

0 commit comments

Comments
 (0)