| | |
| | | import org.eclipse.jgit.lib.Repository;
|
| | | import org.eclipse.jgit.revwalk.RevCommit;
|
| | |
|
| | | import com.gitblit.GitBlit;
|
| | | import com.gitblit.utils.JGitUtils;
|
| | | import com.gitblit.utils.MarkdownUtils;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | |
| | |
|
| | | Repository r = getRepository();
|
| | | RevCommit commit = JGitUtils.getCommit(r, objectId);
|
| | | String [] encodings = GitBlit.getEncodings();
|
| | |
|
| | | // markdown page links
|
| | | add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class,
|
| | |
| | | WicketUtils.newPathParameter(repositoryName, Constants.HEAD, markdownPath)));
|
| | |
|
| | | // Read raw markdown content and transform it to html
|
| | | String markdownText = JGitUtils.getStringContent(r, commit.getTree(), markdownPath);
|
| | | String markdownText = JGitUtils.getStringContent(r, commit.getTree(), markdownPath, encodings);
|
| | | String htmlText;
|
| | | try {
|
| | | htmlText = MarkdownUtils.transformMarkdown(markdownText);
|