Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.
---
export interface Props {
content?: string;
}
const dedent = (str: string) =>
str
.split('\n')
.map((ln) => ln.trimStart())
.join('\n');
// Internal props that should not be part of the external interface.
interface InternalProps extends Props {
$scope: string;
let { content, class: className } = Astro.props as InternalProps;
let html = null;
let htmlContent = '';
const { privateRenderMarkdownDoNotUse: renderMarkdown } = Astro as any;
// If no content prop provided, use the slot.
if (!content) {
const { privateRenderSlotDoNotUse: renderSlot } = Astro as any;
content = await renderSlot('default');
if (content !== undefined && content !== null) {
content = dedent(content);
if (content) {
htmlContent = await renderMarkdown(content, {
mode: 'md',
$: {
scopedClassName: className,
},
});
html = htmlContent;
{html ? html : <slot />}