feat: ajoute rendu markdown aux articles

This commit is contained in:
2025-07-23 12:21:57 +04:00
parent f0e5e07386
commit 09d17dafaa
+2 -3
View File
@@ -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>
)
}