diff --git a/build.sbt b/build.sbt index abd1554..1582493 100644 --- a/build.sbt +++ b/build.sbt @@ -17,7 +17,7 @@ organization := Organization name := Name version := GitBucketVersion -scalaVersion := "2.12.7" +scalaVersion := "2.12.8" scalafmtOnCompile := true diff --git a/src/main/scala/gitbucket/core/plugin/Renderer.scala b/src/main/scala/gitbucket/core/plugin/Renderer.scala index 5a78705..acc6a6f 100644 --- a/src/main/scala/gitbucket/core/plugin/Renderer.scala +++ b/src/main/scala/gitbucket/core/plugin/Renderer.scala @@ -29,7 +29,9 @@ enableWikiLink = enableWikiLink, enableRefsLink = enableRefsLink, enableAnchor = enableAnchor, - enableLineBreaks = false + enableLineBreaks = false, + enableTaskList = true, + hasWritePermission = false )(context) ) } diff --git a/src/main/scala/gitbucket/core/service/PullRequestService.scala b/src/main/scala/gitbucket/core/service/PullRequestService.scala index 7517a1d..185955c 100644 --- a/src/main/scala/gitbucket/core/service/PullRequestService.scala +++ b/src/main/scala/gitbucket/core/service/PullRequestService.scala @@ -10,6 +10,7 @@ import gitbucket.core.util.Directory._ import gitbucket.core.util.Implicits._ import gitbucket.core.util.JGitUtil +import gitbucket.core.util.StringUtil._ import gitbucket.core.util.JGitUtil.{CommitInfo, DiffInfo} import gitbucket.core.view import gitbucket.core.view.helpers @@ -269,8 +270,8 @@ .map { diff => (diff.oldContent, diff.newContent) match { case (Some(oldContent), Some(newContent)) => { - val oldLines = oldContent.replace("\r\n", "\n").split("\n") - val newLines = newContent.replace("\r\n", "\n").split("\n") + val oldLines = convertLineSeparator(oldContent, "LF").split("\n") + val newLines = convertLineSeparator(newContent, "LF").split("\n") file -> Option(DiffUtils.diff(oldLines.toList.asJava, newLines.toList.asJava)) } case _ => diff --git a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html index b28b98d..a130207 100644 --- a/src/main/twirl/gitbucket/core/issues/commentlist.scala.html +++ b/src/main/twirl/gitbucket/core/issues/commentlist.scala.html @@ -6,6 +6,7 @@ commitId: Option[String] = None, renderScript: Boolean = true)(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers +@import gitbucket.core.util.StringUtil._ @issueOrPullRequest()={ @if(issue.exists(_.isPullRequest))( "pull request" )else( "issue" ) } @showFormattedComment(comment: gitbucket.core.model.IssueComment)={
@@ -237,7 +238,7 @@ @helpers.avatar(comment.commentedUserName, 16) @helpers.user(comment.commentedUserName, styleClass="username strong") - change title from @comment.content.split("\r\n")(0) to @comment.content.split("\r\n")(1) + change title from @convertLineSeparator(comment.content, "LF").split("\n")(0) to @convertLineSeparator(comment.content, "LF").split("\n")(1) @gitbucket.core.helper.html.datetimeago(comment.registeredDate)