Allow new-lines to be rendered in <Content />
This commit is contained in:
parent
257b0b1420
commit
2035277e02
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue