diff --git a/css/video-page.css b/css/video-page.css index 7b3cbd4..b96ee81 100644 --- a/css/video-page.css +++ b/css/video-page.css @@ -236,7 +236,79 @@ line-height: 1.6; margin-bottom: 1.5rem; color: #333; - white-space: pre-line; +} + +/* Styles pour les éléments Markdown dans la description */ +.video-description p { + margin-bottom: 1rem; +} + +.video-description ol, +.video-description ul { + margin-bottom: 1rem; + padding-left: 1.5rem; +} + +.video-description li { + margin-bottom: 0.5rem; +} + +.video-description a { + color: var(--primary-red); + text-decoration: none; + transition: color 0.2s; +} + +.video-description a:hover { + text-decoration: underline; +} + +.video-description blockquote { + border-left: 4px solid #e0e0e0; + padding-left: 1rem; + margin-left: 0; + margin-right: 0; + margin-bottom: 1rem; + color: #555; + font-style: italic; +} + +.video-description code { + background-color: #f5f5f5; + padding: 0.2rem 0.4rem; + border-radius: 3px; + font-family: monospace; + font-size: 0.875rem; +} + +.video-description pre { + background-color: #f5f5f5; + padding: 1rem; + border-radius: 4px; + overflow-x: auto; + margin-bottom: 1rem; +} + +.video-description pre code { + background-color: transparent; + padding: 0; + border-radius: 0; + display: block; + white-space: pre; +} + +.video-description hr { + border: 0; + height: 1px; + background-color: #e0e0e0; + margin: 2rem 0; +} + +.video-description .markdown-image { + max-width: 100%; + height: auto; + border-radius: 4px; + margin: 1rem 0; } .truncated-description, .full-description { diff --git a/includes/lib/markdown.php b/includes/lib/markdown.php new file mode 100644 index 0000000..505430e --- /dev/null +++ b/includes/lib/markdown.php @@ -0,0 +1,43 @@ +$1', $markdown); + $markdown = preg_replace('/\*(.*?)\*/s', '$1', $markdown); + + // Conversion des listes à puces + $markdown = preg_replace('/^- (.*?)$/m', '