feat: ajoute rendu markdown aux articles
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import Box from '@mui/material/Box'
|
import Box from '@mui/material/Box'
|
||||||
import Typography from '@mui/material/Typography'
|
import Typography from '@mui/material/Typography'
|
||||||
|
import MarkdownRenderer from '../../markdown-renderer/index.js'
|
||||||
import Edit from './index.js'
|
import Edit from './index.js'
|
||||||
|
|
||||||
export default function Article({session, articleId, numero, contenu}) {
|
export default function Article({session, articleId, numero, contenu}) {
|
||||||
const formattedContent = contenu.replaceAll('\n', '<br />')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box textAlign='justify' p={0.5}>
|
<Box textAlign='justify' p={0.5}>
|
||||||
<Box sx={{display: 'flex', alignItems: 'center'}}>
|
<Box sx={{display: 'flex', alignItems: 'center'}}>
|
||||||
@@ -15,7 +14,7 @@ export default function Article({session, articleId, numero, contenu}) {
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<Typography dangerouslySetInnerHTML={{__html: formattedContent}} />
|
<MarkdownRenderer content={contenu} fallbackComponent={Typography} />
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user