{"record":{"id":"7c61fbb9e078aa8c","repo":"mui/material-ui","slug":"docs-infra-unsupported-language-sh-in-n-n-s","errorCode":null,"errorMessage":"docs-infra: Unsupported language: \"sh\" in:\\n\\n```sh\\n${code}\\n```\\n\\nUse \"bash\" instead.\\n","messagePattern":"docs-infra: Unsupported language: \"sh\" in:\\\\n\\\\n```sh\\\\n(.+?)\\\\n```\\\\n\\\\nUse \"bash\" instead\\.\\\\n","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages-internal/markdown/prism.mjs","lineNumber":24,"sourceCode":"import 'prismjs/components/prism-json.js';\nimport 'prismjs/components/prism-jsx.js';\nimport 'prismjs/components/prism-markup.js';\nimport 'prismjs/components/prism-yaml.js';\nimport 'prismjs/components/prism-tsx.js';\n\nfunction highlight(code, language) {\n  let prismLanguage;\n  switch (language) {\n    case 'ts':\n      prismLanguage = prism.languages.tsx;\n      break;\n\n    case 'js':\n      prismLanguage = prism.languages.jsx;\n      break;\n\n    case 'sh':\n      throw new Error(\n        [\n          `docs-infra: Unsupported language: \"sh\" in:`,\n          '',\n          '```sh',\n          code,\n          '```',\n          '',\n          'Use \"bash\" instead.',\n          '',\n        ].join('\\n'),\n      );\n\n    case 'diff':\n      prismLanguage = { ...prism.languages.diff };\n      // original `/^[-<].*$/m` matches lines starting with `<` which matches\n      // <SomeComponent />\n      // we will only use `-` as the deleted marker\n      prismLanguage.deleted = /^[-].*$/m;","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/mui/material-ui/blob/bdc96df2cb530fcdd60a7a7aabe37f610ce0f0a5/packages-internal/markdown/prism.mjs#L6-L42","documentation":"The docs syntax highlighter (prism.mjs) rejects the `sh` fenced code-block language alias and asks for `bash` instead. The project standardised on `bash` to keep grammar/tokenisation consistent, so `sh` is treated as a configuration error and fails the build with a snippet of the offending block.","triggerScenarios":"Authoring a markdown docs page with a ```sh fenced code block; the build runs the highlighter and throws.","commonSituations":"Copy-pasting shell snippets from external sources that default to ```sh; muscle memory from other doc systems that accept sh.","solutions":["Change the fence from ```sh to ```bash in the offending markdown file (the error includes the code snippet to locate it).","Re-run `pnpm docs:build` to confirm.","Configure your editor/docs linting to flag `sh` fences."],"exampleFix":"```sh\nnpm install\n```\n// after\n```bash\nnpm install\n```","handlingStrategy":"validation","validationCode":"function validateFenceLanguage(lang) {\n  if (lang === 'sh') throw new Error('Use \"bash\" instead of \"sh\" for fenced code blocks');\n}\n// run over each fenced block extracted from markdown","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use ```bash for shell snippets in MUI docs.","Configure editor snippets to default shell fences to bash.","Run `pnpm docs:build` locally before pushing docs."],"tags":["docs-infra","build","syntax-highlighting","style","validation"],"backgroundTag":null,"analyzedSha":"bdc96df2cb530fcdd60a7a7aabe37f610ce0f0a5","analyzedAt":"2026-08-12T22:59:56.717Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}