Handle empty strings in code blocks

Signed-off-by: irma12 <irma@roadie.io>
This commit is contained in:
irma12
2021-07-06 15:06:43 +02:00
parent 8f6fbf0232
commit 2a13aa1b75
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Handle empty code blocks in markdown files so they don't fail rendering
@@ -65,8 +65,8 @@ type Props = {
};
const renderers = {
code: ({ language, value }: { language: string; value: string }) => {
return <CodeSnippet language={language} text={value} />;
code: ({ language, value }: { language: string; value?: string }) => {
return <CodeSnippet language={language} text={value ?? ''} />;
},
};