Allow new-lines to be rendered in <Content />

This commit is contained in:
Eric Jinks 2017-12-07 15:13:19 +10:00
parent 257b0b1420
commit 2035277e02

View file

@ -4,7 +4,7 @@ import Marked from 'react-markdown'
import { getImageSrc, getImageSrcset } from '../util/getImageUrl'
export default ({ source }) => (
<Marked
<Content
source={source}
renderers={{
Image: ImageWithSrcset
@ -16,6 +16,9 @@ const Image = styled.img`
max-width: 100%;
height: auto;
`
const Content = styled(Marked)`
white-space: pre-line;
`
const ImageWithSrcset = props => (
<Image