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