summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/MarkupProcessor.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-05-05 09:53:24 -0400
committerJames Moger <james.moger@gitblit.com>2014-05-05 09:53:24 -0400
commitff17f7bac432b4ba8310ba3ea335748a34859d50 (patch)
tree58278b648975c83e5af80cb79f3cf6f0bf78759c /src/main/java/com/gitblit/wicket/MarkupProcessor.java
parent1946fe76331b37c5a3be97268f0e3b0e58f3bb00 (diff)
downloadgitblit-ff17f7bac432b4ba8310ba3ea335748a34859d50.tar.gz
gitblit-ff17f7bac432b4ba8310ba3ea335748a34859d50.zip
Replace RawPage with RawServlet
Diffstat (limited to 'src/main/java/com/gitblit/wicket/MarkupProcessor.java')
-rw-r--r--src/main/java/com/gitblit/wicket/MarkupProcessor.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/com/gitblit/wicket/MarkupProcessor.java b/src/main/java/com/gitblit/wicket/MarkupProcessor.java
index ff6fbce2..e7681f2c 100644
--- a/src/main/java/com/gitblit/wicket/MarkupProcessor.java
+++ b/src/main/java/com/gitblit/wicket/MarkupProcessor.java
@@ -56,11 +56,11 @@ import org.slf4j.LoggerFactory;
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;
/**
@@ -260,7 +260,8 @@ public class MarkupProcessor {
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;
@@ -312,7 +313,8 @@ public class MarkupProcessor {
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
@@ -325,7 +327,8 @@ public class MarkupProcessor {
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