zed-industries/zed · error

Paste a GitHub blob URL that points to a .md file

Error message

Paste a GitHub blob URL that points to a .md file

What it means

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.

Source

Thrown at crates/settings_ui/src/pages/skill_creator.rs:1095

        .ok_or_else(|| anyhow!("Enter a valid GitHub URL"))?;
    let path_segments = url
        .path_segments()
        .ok_or_else(|| anyhow!("Enter a valid GitHub URL"))?
        .collect::<Vec<_>>();

    match host {
        "github.com" => github_blob_raw_url(&path_segments),
        "raw.githubusercontent.com" => {
            ensure_markdown_path(&path_segments)?;
            Ok(url.into())
        }
        _ => anyhow::bail!("Paste a GitHub .md URL"),
    }
}

fn github_blob_raw_url(path_segments: &[&str]) -> Result<String> {
    let [owner, repo, kind, reference, file_path @ ..] = path_segments else {
        anyhow::bail!("Paste a GitHub blob URL that points to a .md file");
    };

    if *kind != "blob" {
        anyhow::bail!("Paste a GitHub blob URL that points to a .md file");
    }

    ensure_markdown_path(file_path)?;
    Ok(format!(
        "https://raw.githubusercontent.com/{owner}/{repo}/{reference}/{}",
        file_path.join("/")
    ))
}

fn ensure_markdown_path(path_segments: &[&str]) -> Result<()> {
    let Some(file_name) = path_segments.last() else {
        anyhow::bail!("Paste a GitHub .md URL");
    };

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Open the SKILL.md file on GitHub and copy the URL from the file view (contains /blob/)
  2. Paste the raw.githubusercontent.com URL of the .md file instead
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/settings_ui/src/pages/skill_creator.rs:1095 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/0958a2e9b00f6654. Report an issue: GitHub.