diff --git a/pages/admin/index.js b/pages/admin/index.js index 4e30eb6..b8efb5e 100644 --- a/pages/admin/index.js +++ b/pages/admin/index.js @@ -306,7 +306,7 @@ export default function AdminPanel() { id={`content-${index}`} value={content.value} onChange={(e) => handleContentChange(index, e.target.value)} - className="w-full p-3 border rounded-lg font-mono text-sm" + className="w-full p-3 border rounded-lg font-mono text-sm whitespace-pre-wrap" rows={content.type === 'text' ? "8" : "3"} placeholder={content.type === 'text' ? 'Hier können Sie **Markdown** verwenden...' : 'Bild-URL eingeben...'} /> @@ -316,7 +316,33 @@ export default function AdminPanel() {
Vorschau:
- +

{children}

, + code: ({node, inline, className, children, ...props}) => { + const match = /language-(\w+)/.exec(className || ''); + return !inline ? ( +
+                                  
+                                    {children}
+                                  
+                                
+ ) : ( + + {children} + + ); + } + }} + > {content.value || '*Keine Inhalte zum Anzeigen*'}
diff --git a/pages/blog/[slug].js b/pages/blog/[slug].js index 9ecfd27..53422a1 100644 --- a/pages/blog/[slug].js +++ b/pages/blog/[slug].js @@ -51,7 +51,7 @@ export default function BlogPost({ blog }) { h1: ({children}) =>

{children}

, h2: ({children}) =>

{children}

, h3: ({children}) =>

{children}

, - p: ({children}) =>

{children}

, + p: ({children}) =>

{children}

, strong: ({children}) => {children}, em: ({children}) => {children}, ul: ({children}) => , @@ -59,8 +59,26 @@ export default function BlogPost({ blog }) { li: ({children}) =>
  • {children}
  • , a: ({href, children}) => {children}, blockquote: ({children}) =>
    {children}
    , - code: ({children}) => {children}, - pre: ({children}) =>
    {children}
    + code: ({node, inline, className, children, ...props}) => { + const match = /language-(\w+)/.exec(className || ''); + return !inline ? ( +
    +                              
    +                                {children}
    +                              
    +                            
    + ) : ( + + {children} + + ); + } }} > {item} @@ -73,7 +91,7 @@ export default function BlogPost({ blog }) {

    {children}

    , h2: ({children}) =>

    {children}

    ,