fix: Tabellen-Rendering und Prose-Styling verbessert
- remark-gfm hinzugefuegt fuer GFM-Tabellen-Support - Tabellen-CSS: Header, Hover, Spacing, responsive overflow - Prose H1-Styling fuer Guide-Titel aus Markdown - Horizontale Linien, Strong-Tags, Listen in Tabellen - Alle Guides: Tabellen werden jetzt als HTML-<table> gerendert Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -156,3 +156,62 @@ body {
|
||||
color: var(--muted-fg);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* Tabellen */
|
||||
.prose table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 1.5rem 0;
|
||||
font-size: 0.875rem;
|
||||
overflow-x: auto;
|
||||
display: block;
|
||||
}
|
||||
.prose thead {
|
||||
border-bottom: 2px solid var(--border-color);
|
||||
}
|
||||
.prose th {
|
||||
padding: 0.625rem 1rem;
|
||||
text-align: left;
|
||||
font-weight: 600;
|
||||
color: var(--fg);
|
||||
background: var(--surface);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.prose td {
|
||||
padding: 0.5rem 1rem;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
vertical-align: top;
|
||||
}
|
||||
.prose tbody tr:hover {
|
||||
background: var(--surface-hover);
|
||||
}
|
||||
.prose tbody tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/* Tipp-/Info-Boxen (fett gedruckte Hinweise) */
|
||||
.prose strong {
|
||||
font-weight: 600;
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
/* Horizontale Linien */
|
||||
.prose hr {
|
||||
border: none;
|
||||
border-top: 1px solid var(--border-color);
|
||||
margin: 2rem 0;
|
||||
}
|
||||
|
||||
/* Listen in Tabellen */
|
||||
.prose td ul, .prose td ol {
|
||||
padding-left: 1.25em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* H1 innerhalb von prose (aus Markdown-Content) */
|
||||
.prose h1 {
|
||||
font-size: 1.875rem;
|
||||
font-weight: 800;
|
||||
margin-bottom: 0.5em;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import fs from "fs";
|
||||
import path from "path";
|
||||
import matter from "gray-matter";
|
||||
import { remark } from "remark";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import html from "remark-html";
|
||||
import readingTime from "reading-time";
|
||||
|
||||
@@ -57,7 +58,7 @@ export const getGuideBySlug = async (slug: string): Promise<Guide | null> => {
|
||||
const fileContent = fs.readFileSync(filePath, "utf-8");
|
||||
const { data, content } = matter(fileContent);
|
||||
const stats = readingTime(content);
|
||||
const processed = await remark().use(html).process(content);
|
||||
const processed = await remark().use(remarkGfm).use(html, { sanitize: false }).process(content);
|
||||
|
||||
return {
|
||||
title: data.title ?? slug,
|
||||
@@ -86,7 +87,7 @@ export const getPageContent = async (
|
||||
|
||||
const fileContent = fs.readFileSync(filePath, "utf-8");
|
||||
const { data, content } = matter(fileContent);
|
||||
const processed = await remark().use(html).process(content);
|
||||
const processed = await remark().use(remarkGfm).use(html, { sanitize: false }).process(content);
|
||||
|
||||
return {
|
||||
title: data.title ?? slug,
|
||||
|
||||
Reference in New Issue
Block a user