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() {
{children}
, + code: ({node, inline, className, children, ...props}) => { + const match = /language-(\w+)/.exec(className || ''); + return !inline ? ( +
+
+ {children}
+
+
+ ) : (
+
+ {children}
+
+ );
+ }
+ }}
+ >
{content.value || '*Keine Inhalte zum Anzeigen*'}
{children}
, + p: ({children}) =>{children}
, strong: ({children}) => {children}, em: ({children}) => {children}, ul: ({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 }) {