mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
Added ErrorBoundary to MarkdownView to avoid invalid markdown crashes the entire page
This commit is contained in:
@@ -5,19 +5,24 @@ import styled from "styled-components";
|
||||
|
||||
import TestPage from "./__resources__/test-page.md";
|
||||
import MarkdownWithoutLang from "./__resources__/markdown-without-lang.md";
|
||||
import MarkdownXmlCodeBlock from "./__resources__/markdown-xml-codeblock.md";
|
||||
import MarkdownInlineXml from "./__resources__/markdown-inline-xml.md";
|
||||
import Title from "./layout/Title";
|
||||
import { Subtitle } from "./layout";
|
||||
|
||||
const Spacing = styled.div`
|
||||
padding: 2em;
|
||||
`;
|
||||
|
||||
storiesOf("MarkdownView", module)
|
||||
.add("Default", () => (
|
||||
<Spacing>
|
||||
<MarkdownView content={TestPage} skipHtml={false} />
|
||||
</Spacing>
|
||||
))
|
||||
.add("Code without Lang", () => (
|
||||
<Spacing>
|
||||
<MarkdownView content={MarkdownWithoutLang} skipHtml={false} />
|
||||
</Spacing>
|
||||
.addDecorator(story => <Spacing>{story()}</Spacing>)
|
||||
.add("Default", () => <MarkdownView content={TestPage} skipHtml={false} />)
|
||||
.add("Code without Lang", () => <MarkdownView content={MarkdownWithoutLang} skipHtml={false} />)
|
||||
.add("Xml Code Block", () => <MarkdownView content={MarkdownXmlCodeBlock} />)
|
||||
.add("Inline Xml", () => (
|
||||
<>
|
||||
<Title title="Inline Xml" />
|
||||
<Subtitle subtitle="Inline xml outside of a code block is not supported" />
|
||||
<MarkdownView content={MarkdownInlineXml} />
|
||||
</>
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user