removeTemplateMarkerSections() — astro Function Reference
Architecture documentation for the removeTemplateMarkerSections() function in template.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 1ce03599_63aa_c670_0279_e9705ea75c5a["removeTemplateMarkerSections()"] 33b7e98e_3257_427a_5948_5ab38c474d26["template.ts"] 1ce03599_63aa_c670_0279_e9705ea75c5a -->|defined in| 33b7e98e_3257_427a_5948_5ab38c474d26 5efefaab_aaa7_f01a_cf9f_0451f47845c8["processTemplateReadme()"] 5efefaab_aaa7_f01a_cf9f_0451f47845c8 -->|calls| 1ce03599_63aa_c670_0279_e9705ea75c5a style 1ce03599_63aa_c670_0279_e9705ea75c5a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/create-astro/src/actions/template.ts lines 16–27
export function removeTemplateMarkerSections(content: string): string {
// Pattern to match HTML template marker sections
const pattern = /<!--\s*ASTRO:REMOVE:START\s*-->[\s\S]*?<!--\s*ASTRO:REMOVE:END\s*-->/gi;
let result = content.replace(pattern, '');
// Clean up extra whitespace that might be left behind
// Replace multiple consecutive newlines with at most 2 newlines
result = result.replace(/\n{3,}/g, '\n\n');
return result;
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does removeTemplateMarkerSections() do?
removeTemplateMarkerSections() is a function in the astro codebase, defined in packages/create-astro/src/actions/template.ts.
Where is removeTemplateMarkerSections() defined?
removeTemplateMarkerSections() is defined in packages/create-astro/src/actions/template.ts at line 16.
What calls removeTemplateMarkerSections()?
removeTemplateMarkerSections() is called by 1 function(s): processTemplateReadme.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free