mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +01:00
Refactor to use ProjectService instead of JGitUtil directly to retrieve project information.
This commit is contained in:
@@ -25,7 +25,7 @@ object helpers {
|
||||
/**
|
||||
* Converts the issue number and the commit id to the link.
|
||||
*/
|
||||
private def markdownFilter(value: String, repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context): String = {
|
||||
private def markdownFilter(value: String, repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context): String = {
|
||||
value
|
||||
.replaceAll("#([0-9]+)", "[$0](%s/%s/%s/issue/$1)".format(context.path, repository.owner, repository.name))
|
||||
.replaceAll("[0-9a-z]{10,40}", "[$0](%s/%s/%s/commit/$0)".format(context.path, repository.owner, repository.name))
|
||||
@@ -34,7 +34,7 @@ object helpers {
|
||||
/**
|
||||
* Converts Markdown of Wiki pages to HTML.
|
||||
*/
|
||||
def markdown(value: String, repository: util.JGitUtil.RepositoryInfo, wikiLink: Boolean)(implicit context: app.Context): twirl.api.Html = {
|
||||
def markdown(value: String, repository: service.ProjectService.RepositoryInfo, wikiLink: Boolean)(implicit context: app.Context): twirl.api.Html = {
|
||||
import org.pegdown._
|
||||
val html = new PegDownProcessor(Extensions.AUTOLINKS|Extensions.WIKILINKS|Extensions.FENCED_CODE_BLOCKS)
|
||||
.markdownToHtml(markdownFilter(value, repository), new LinkRenderer(){
|
||||
|
||||
Reference in New Issue
Block a user