Skip to content

Commit 737cca4

Browse files
committed
give code some room
1 parent 3c09355 commit 737cca4

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/MarkdownRenderer.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ class CodeBlock extends React.PureComponent<
117117
function PlainImage(imageProps) {
118118
const {isRss, src, ...props} = imageProps;
119119
return (
120-
<Box as="span" align="center" justify="center" style={{display: 'flex'}}>
120+
<Box
121+
margin={{vertical: 'medium'}}
122+
as="span"
123+
align="center"
124+
justify="center"
125+
style={{display: 'flex'}}>
121126
{/*eslint-disable-next-line jsx-a11y/alt-text*/}
122127
<img style={{maxWidth: '100%'}} src={imageUrl({src})} {...props} />
123128
{props.isRss ? <br /> : null}
@@ -143,7 +148,11 @@ function isGif(src: string) {
143148

144149
function Image(props) {
145150
if (props.src && isGif(props.src)) {
146-
return <GifPlayer style={{maxWidth: '100%'}} src={props.src} />;
151+
return (
152+
<Box margin={{vertical: 'medium'}}>
153+
<GifPlayer style={{maxWidth: '100%'}} src={props.src} />
154+
</Box>
155+
);
147156
}
148157
return <PlainImage {...props} />;
149158
}
@@ -293,7 +302,11 @@ const defaultRenderers = ({
293302
if (props.language === 'backmatter') {
294303
return null;
295304
}
296-
return <CodeBlock {...props} />;
305+
return (
306+
<Box margin={{vertical: 'small'}}>
307+
<CodeBlock {...props} />
308+
</Box>
309+
);
297310
},
298311
image: Image,
299312
paragraph: ParagraphWrapper,

0 commit comments

Comments
 (0)