diff --git a/public/script/app.js b/public/script/app.js
index 11b9ac6..a3067ad 100644
--- a/public/script/app.js
+++ b/public/script/app.js
@@ -1460,7 +1460,16 @@ angular
let baseUrl = "";
try {
const o = parseGithubUrl($scope.sourceUrl);
- baseUrl = `https://github.com/${o.owner}/${o.repo}/raw/${$scope.source.branch}/`;
+ // Fall back to the repo's default branch when source.branch
+ // hasn't loaded yet — without this, relative
+ // resolved against a baseUrl like ".../raw//" (no branch
+ // segment), so the browser fetched ".../raw/X" and 404'd
+ // (#407).
+ const branch =
+ $scope.source.branch ||
+ ($scope.details && $scope.details.defaultBranch) ||
+ "main";
+ baseUrl = `https://github.com/${o.owner}/${o.repo}/raw/${branch}/`;
} catch (_) { /* fall through with empty base */ }
const html = renderMD($scope.anonymize_readme, baseUrl);
$scope.html_readme = $sce.trustAsHtml(html);
diff --git a/public/script/bundle.min.js b/public/script/bundle.min.js
index 5233f65..c1345e9 100644
--- a/public/script/bundle.min.js
+++ b/public/script/bundle.min.js
@@ -2622,4 +2622,4 @@ Expecting `+E.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on l
:root { --mermaid-alt-font-family: ${t.altFontFamily}}`),i instanceof Map){let e=t.htmlLabels??t.flowchart?.htmlLabels?["> *","span"]:["rect","polygon","ellipse","circle","path"];i.forEach(t=>{gq(t.styles)||e.forEach(e=>{n+=$Fe(t.id,e,t.styles)}),gq(t.textStyles)||(n+=$Fe(t.id,"tspan",(t?.textStyles||[]).map(e=>e.replace("color","fill"))))})}return n},"createCssStyles"),RFe=mt((e,t,i,n)=>{i=LFe(e,i);return uFe(aFe(n+`{${ch(t,i,e.themeVariables)}}`),dFe)},"createUserStyles"),MFe=mt((e="",t,i)=>{let n=e;return i||t||(n=n.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),n=(n=n_(n)).replace(/
/g,"
")},"cleanUpSvgCode"),IFe=mt((e="",t)=>{return`