Home / Function/ renderErrorMarkdown() — astro Function Reference

renderErrorMarkdown() — astro Function Reference

Architecture documentation for the renderErrorMarkdown() function in runtime.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  74d0f50f_b742_693c_951c_41572a0461d6["renderErrorMarkdown()"]
  d9525c93_ef37_466a_289a_043691fd3f8a["runtime.ts"]
  74d0f50f_b742_693c_951c_41572a0461d6 -->|defined in| d9525c93_ef37_466a_289a_043691fd3f8a
  style 74d0f50f_b742_693c_951c_41572a0461d6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/errors/dev/runtime.ts lines 27–40

export function renderErrorMarkdown(markdown: string, target: 'html' | 'cli') {
	if (target === 'html') {
		return escape(markdown)
			.replace(linkRegex, `<a href="$2" target="_blank">$1</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) => `${colors.bold(m1)} ${colors.underline(m2)}`)
			.replace(urlRegex, (fullMatch) => ` ${colors.underline(fullMatch.trim())}`)
			.replace(boldRegex, (_, m1) => `${colors.bold(m1)}`);
	}
}

Domain

Subdomains

Frequently Asked Questions

What does renderErrorMarkdown() do?
renderErrorMarkdown() is a function in the astro codebase, defined in packages/astro/src/core/errors/dev/runtime.ts.
Where is renderErrorMarkdown() defined?
renderErrorMarkdown() is defined in packages/astro/src/core/errors/dev/runtime.ts at line 27.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free