mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
Render images from repository correctly
This adds a markdown renderer for images, so that images that are referenced by their repository path are resolved correctly. In this case, the content rest endpoint is rendered as source url. For this, two new contexts (RepositoryContext and RepositoryRevisionContext) have been added, that make the repository and the current revision available, so that the content url can be resolved properly. These new contexts may be used by plugins like the scm-readme-plugin. Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com> Reviewed-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
committed by
SCM-Manager
parent
6ba792e5bc
commit
f2f2f29791
@@ -91,6 +91,9 @@ public class GitCatCommand extends AbstractGitCommand implements CatCommand {
|
||||
private Loader getLoader(CatCommandRequest request) throws IOException {
|
||||
org.eclipse.jgit.lib.Repository repo = open();
|
||||
ObjectId revId = getCommitOrDefault(repo, request.getRevision());
|
||||
if (revId == null) {
|
||||
throw notFound(entity("Revision", request.getRevision()).in(repository));
|
||||
}
|
||||
logger.info("loading content for file {} for revision {} in repository {}", request.getPath(), revId, repository);
|
||||
return getLoader(repo, revId, request.getPath());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user