| | |
| | | import com.gitblit.IStoredSettings;
|
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.models.PathModel;
|
| | | import com.gitblit.servlet.RawServlet;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | import com.gitblit.utils.StringUtils;
|
| | | import com.gitblit.wicket.pages.DocPage;
|
| | | import com.gitblit.wicket.pages.RawPage;
|
| | | import com.google.common.base.Joiner;
|
| | |
|
| | | /**
|
| | |
| | | if (imagePath.indexOf("://") == -1) {
|
| | | // relative image
|
| | | String path = doc.getRelativePath(imagePath);
|
| | | url = getWicketUrl(RawPage.class, repositoryName, commitId, path);
|
| | | String contextUrl = RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot();
|
| | | url = RawServlet.asLink(contextUrl, repositoryName, commitId, path);
|
| | | } else {
|
| | | // absolute image
|
| | | url = imagePath;
|
| | |
| | | if (node.url.indexOf("://") == -1) {
|
| | | // repository-relative image link
|
| | | String path = doc.getRelativePath(node.url);
|
| | | String url = getWicketUrl(RawPage.class, repositoryName, commitId, path);
|
| | | String contextUrl = RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot();
|
| | | String url = RawServlet.asLink(contextUrl, repositoryName, commitId, path);
|
| | | return new Rendering(url, text);
|
| | | }
|
| | | // absolute image link
|
| | |
| | | if (url.indexOf("://") == -1) {
|
| | | // repository-relative image link
|
| | | String path = doc.getRelativePath(url);
|
| | | String wurl = getWicketUrl(RawPage.class, repositoryName, commitId, path);
|
| | | String contextUrl = RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot();
|
| | | String wurl = RawServlet.asLink(contextUrl, repositoryName, commitId, path);
|
| | | rendering = new Rendering(wurl, alt);
|
| | | } else {
|
| | | // absolute image link
|