Skip to content

Commit aa79b70

Browse files
committed
Fix handling of image links to nested folder.
- Improve disallowed repository reference handline with a link to the actual github repository location. - Allow eclipse-simrel/.github to be rendered.
1 parent 55fadb0 commit aa79b70

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

markdown/index.html

+12-3
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
"eclipse-pde/eclipse.pde": "PDE",
118118
"eclipse-equinox/p2": "Equinox p2",
119119
"eclipse-ide/.github": "Eclipse IDE",
120+
"eclipse-simrel/.github": "Eclipse SimRel",
120121
};
121122

122123
function getFileParameter() {
@@ -137,7 +138,7 @@
137138
if (parts == null) {
138139
return `${markdownBase}${path}`;
139140
}
140-
return `${selfHostedMarkdownBase}${parts[1].replace(/^\//,'')}`;
141+
return `${selfHostedMarkdownBase}${parts[1].replace(/^\//, '')}`;
141142
}
142143

143144
const file = getFileParameter();
@@ -262,7 +263,7 @@ <h2>Table of Contents</h2>
262263
if (siteURL != null) {
263264
img.src = siteURL;
264265
} else {
265-
img.src = `https://raw.githubusercontent.com/${org}/${repo}/${branch}/${src}`;
266+
img.src = new URL(`https://raw.githubusercontent.com/${org}/${repo}/${branch}/${path}/../${src}`);
266267
}
267268
}
268269
}
@@ -332,7 +333,15 @@ <h2>Table of Contents</h2>
332333
targetElement.innerHTML = 'No well-formed query parameter of the form <code>?file=org/repo/branch/path</code> has been specified.';
333334
} else {
334335
if (repoName == null) {
335-
targetElement.innerHTML = `The repository ${org}/${repo} is not on the allowed list.`;
336+
const url = `https://github.com/${org}/${repo}/${branch}/${path}`;
337+
targetElement.innerHTML = `
338+
<div>
339+
The repository ${org}/${repo} is not on the allowed list.
340+
</div>
341+
<ul>
342+
<li><a href="{$url}${window.location.hash}">${url}</a></li>
343+
</ul>
344+
`;
336345
} else {
337346
document.title = `${repoName} Documentation | Eclipse Project`;
338347

0 commit comments

Comments
 (0)