{"record":{"id":"0958a2e9b00f6654","repo":"zed-industries/zed","slug":"paste-a-github-blob-url-that-points-to-a-md-file","errorCode":null,"errorMessage":"Paste a GitHub blob URL that points to a .md file","messagePattern":"Paste a GitHub blob URL that points to a \\.md file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/settings_ui/src/pages/skill_creator.rs","lineNumber":1095,"sourceCode":"        .ok_or_else(|| anyhow!(\"Enter a valid GitHub URL\"))?;\n    let path_segments = url\n        .path_segments()\n        .ok_or_else(|| anyhow!(\"Enter a valid GitHub URL\"))?\n        .collect::<Vec<_>>();\n\n    match host {\n        \"github.com\" => github_blob_raw_url(&path_segments),\n        \"raw.githubusercontent.com\" => {\n            ensure_markdown_path(&path_segments)?;\n            Ok(url.into())\n        }\n        _ => anyhow::bail!(\"Paste a GitHub .md URL\"),\n    }\n}\n\nfn github_blob_raw_url(path_segments: &[&str]) -> Result<String> {\n    let [owner, repo, kind, reference, file_path @ ..] = path_segments else {\n        anyhow::bail!(\"Paste a GitHub blob URL that points to a .md file\");\n    };\n\n    if *kind != \"blob\" {\n        anyhow::bail!(\"Paste a GitHub blob URL that points to a .md file\");\n    }\n\n    ensure_markdown_path(file_path)?;\n    Ok(format!(\n        \"https://raw.githubusercontent.com/{owner}/{repo}/{reference}/{}\",\n        file_path.join(\"/\")\n    ))\n}\n\nfn ensure_markdown_path(path_segments: &[&str]) -> Result<()> {\n    let Some(file_name) = path_segments.last() else {\n        anyhow::bail!(\"Paste a GitHub .md URL\");\n    };\n","sourceCodeStart":1077,"sourceCodeEnd":1113,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/settings_ui/src/pages/skill_creator.rs#L1077-L1113","documentation":"Raised in github_raw_url when the host is github.com but the path segments do not form a valid blob URL (wrong segment count, kind not 'blob', or the trailing file path is not a .md file). The URL must point at a GitHub blob path ending in .md to be convertible to a raw URL.","triggerScenarios":"Thrown at crates/settings_ui/src/pages/skill_creator.rs:1095 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the SKILL.md file on GitHub and copy the URL from the file view (contains /blob/)","Paste the raw.githubusercontent.com URL of the .md file instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}