renderErrorMarkdown() — astro Function Reference
Architecture documentation for the renderErrorMarkdown() function in utils.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD e1326ff1_3ecc_459a_c2d8_37e378c63919["renderErrorMarkdown()"] 6382d0b9_8ae6_1f6a_25b6_41a3e8e6de51["utils.ts"] e1326ff1_3ecc_459a_c2d8_37e378c63919 -->|defined in| 6382d0b9_8ae6_1f6a_25b6_41a3e8e6de51 0d09cf30_b4d9_6d4f_90ab_58174f1f4543["isAllowedUrl()"] e1326ff1_3ecc_459a_c2d8_37e378c63919 -->|calls| 0d09cf30_b4d9_6d4f_90ab_58174f1f4543 style e1326ff1_3ecc_459a_c2d8_37e378c63919 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/core/errors/dev/utils.ts lines 264–289
export function renderErrorMarkdown(markdown: string, target: 'html' | 'cli') {
if (target === 'html') {
return escape(markdown)
.replace(linkRegex, (_match, text, url) => {
if (!isAllowedUrl(url)) {
return text;
}
return `<a href="${url}" target="_blank">${text}</a>`;
})
.replace(boldRegex, '<b>$1</b>')
.replace(urlRegex, ' <a href="$1" target="_blank">$1</a>')
.replace(codeRegex, '<code>$1</code>');
} else {
return markdown
.replace(linkRegex, (_, m1, m2) => {
if (!isAllowedUrl(m2)) {
return `${colors.bold(m1)} ${m2}`;
}
return `${colors.bold(m1)} ${colors.underline(m2)}`;
})
.replace(urlRegex, (fullMatch) => ` ${colors.underline(fullMatch.trim())}`)
.replace(boldRegex, (_, m1) => `${colors.bold(m1)}`);
}
}
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does renderErrorMarkdown() do?
renderErrorMarkdown() is a function in the astro codebase, defined in packages/astro/src/core/errors/dev/utils.ts.
Where is renderErrorMarkdown() defined?
renderErrorMarkdown() is defined in packages/astro/src/core/errors/dev/utils.ts at line 264.
What does renderErrorMarkdown() call?
renderErrorMarkdown() calls 1 function(s): isAllowedUrl.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free