Code Block Examples
50 words
1 minute
Code Block Examples
This page checks code block rendering in English pages.
TypeScript
type SupportedLang = "zh" | "en";
function withLangPrefix(pathname: string, lang: SupportedLang) { const stripped = pathname.replace(/^\/(zh|en)(?=\/|$)/, ""); return `/${lang}${stripped || "/"}`;}
console.log(withLangPrefix("/posts/demo/", "en"));PowerShell
npm run type-checknpx astro checknpm run buildBash
pnpm installpnpm devJSON
{ "language": "en", "route": "/en/posts/markdown/code-examples/", "pagefind": true}Support & Share
If this article helped you, please share or support!
Code Block Examples
https://docs.bingyun.vip/en/posts/markdown/code-examples/ Related Posts Smart
1
KaTeX Math Example
Markdown Inline and block math examples rendered with KaTeX.
2
Markdown Extensions
Markdown Extended Markdown features supported by Firefly.
3
Markdown Mermaid Diagrams
Markdown Mermaid diagram examples for English content rendering.
4
Markdown PlantUML Diagrams
Markdown PlantUML examples for checking diagram rendering.
5
Markdown Tutorial
Markdown A compact Markdown sample article for testing rendering and search.
Random Posts Random