{children}
);
}
const codeString = String(children).replace(/\n$/, "");
const language = match ? match[1] : "text";
const isTextBlock = language === "text";
// Custom styles for text blocks to enable wrapping
const textBlockStyle = isTextBlock ? {
whiteSpace: "pre-wrap" as const,
wordWrap: "break-word" as const,
overflowWrap: "break-word" as const,
} : {};
return (
{match && {match[1]}}
{codeString}
);
},
img({ src, alt }) {
return (
{alt && {alt}}
);
},
a({ href, children }) {
const isExternal = href?.startsWith("http");
return (
{children}
);
},
blockquote({ children }) {
return (
{children}
);
},
h1({ children }) {
const id = generateSlug(getTextContent(children));
return (
{children}
);
},
h2({ children }) {
const id = generateSlug(getTextContent(children));
return (
{children}
);
},
h3({ children }) {
const id = generateSlug(getTextContent(children));
return (
{children}
);
},
h4({ children }) {
const id = generateSlug(getTextContent(children));
return (
{children}
);
},
h5({ children }) {
const id = generateSlug(getTextContent(children));
return (
{children}
);
},
h6({ children }) {
const id = generateSlug(getTextContent(children));
return (
{children}
);
},
ul({ children }) {
return ;
},
ol({ children }) {
return {children}
;
},
li({ children }) {
return {children};
},
hr() {
return
;
},
// Table components for GitHub-style tables
table({ children }) {
return (
);
},
thead({ children }) {
return {children};
},
tbody({ children }) {
return {children};
},
tr({ children }) {
return {children}
;
},
th({ children }) {
return {children} | ;
},
td({ children }) {
return {children} | ;
},
}}
>
{content}
);
}