mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-05 04:56:02 +01:00
(refs #830)Bump pegdown to 1.5.0 and support strike syntax
This commit is contained in:
@@ -10,7 +10,7 @@ import sbtassembly.AssemblyKeys._
|
|||||||
object MyBuild extends Build {
|
object MyBuild extends Build {
|
||||||
val Organization = "gitbucket"
|
val Organization = "gitbucket"
|
||||||
val Name = "gitbucket"
|
val Name = "gitbucket"
|
||||||
val Version = System.getenv("GITBUCKET_VERSION")
|
val Version = "3.5.0-SNAPSHOT"
|
||||||
val ScalaVersion = "2.11.6"
|
val ScalaVersion = "2.11.6"
|
||||||
val ScalatraVersion = "2.3.1"
|
val ScalatraVersion = "2.3.1"
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ object MyBuild extends Build {
|
|||||||
"org.json4s" %% "json4s-jackson" % "3.2.11",
|
"org.json4s" %% "json4s-jackson" % "3.2.11",
|
||||||
"jp.sf.amateras" %% "scalatra-forms" % "0.1.0",
|
"jp.sf.amateras" %% "scalatra-forms" % "0.1.0",
|
||||||
"commons-io" % "commons-io" % "2.4",
|
"commons-io" % "commons-io" % "2.4",
|
||||||
"org.pegdown" % "pegdown" % "1.4.1", // 1.4.2 has incompatible APi changes
|
"org.pegdown" % "pegdown" % "1.5.0",
|
||||||
"org.apache.commons" % "commons-compress" % "1.9",
|
"org.apache.commons" % "commons-compress" % "1.9",
|
||||||
"org.apache.commons" % "commons-email" % "1.3.3",
|
"org.apache.commons" % "commons-email" % "1.3.3",
|
||||||
"org.apache.httpcomponents" % "httpclient" % "4.3.6",
|
"org.apache.httpcomponents" % "httpclient" % "4.3.6",
|
||||||
|
|||||||
@@ -47,10 +47,14 @@ object Markdown {
|
|||||||
} else s
|
} else s
|
||||||
|
|
||||||
val rootNode = new PegDownProcessor(
|
val rootNode = new PegDownProcessor(
|
||||||
Extensions.AUTOLINKS | Extensions.WIKILINKS | Extensions.FENCED_CODE_BLOCKS | Extensions.TABLES | Extensions.HARDWRAPS | Extensions.SUPPRESS_ALL_HTML
|
Extensions.AUTOLINKS | Extensions.WIKILINKS | Extensions.FENCED_CODE_BLOCKS |
|
||||||
|
Extensions.TABLES | Extensions.HARDWRAPS | Extensions.SUPPRESS_ALL_HTML | Extensions.STRIKETHROUGH
|
||||||
).parseMarkdown(source.toCharArray)
|
).parseMarkdown(source.toCharArray)
|
||||||
|
|
||||||
new GitBucketHtmlSerializer(markdown, repository, enableWikiLink, enableRefsLink, enableAnchor, enableTaskList, hasWritePermission, pages).toHtml(rootNode)
|
new GitBucketHtmlSerializer(
|
||||||
|
markdown, repository, enableWikiLink, enableRefsLink, enableAnchor, enableTaskList,
|
||||||
|
hasWritePermission, pages
|
||||||
|
).toHtml(rootNode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,9 +122,9 @@ class GitBucketHtmlSerializer(
|
|||||||
Map[String, VerbatimSerializer](VerbatimSerializer.DEFAULT -> new GitBucketVerbatimSerializer).asJava
|
Map[String, VerbatimSerializer](VerbatimSerializer.DEFAULT -> new GitBucketVerbatimSerializer).asJava
|
||||||
) with LinkConverter with RequestCache {
|
) with LinkConverter with RequestCache {
|
||||||
|
|
||||||
override protected def printImageTag(imageNode: SuperNode, url: String): Unit = {
|
override protected def printImageTag(rendering: LinkRenderer.Rendering): Unit = {
|
||||||
printer.print("<a target=\"_blank\" href=\"").print(fixUrl(url, true)).print("\">")
|
printer.print("<a target=\"_blank\" href=\"").print(fixUrl(rendering.href, true)).print("\">")
|
||||||
.print("<img src=\"").print(fixUrl(url, true)).print("\" alt=\"").printEncoded(printChildrenToString(imageNode)).print("\"/></a>")
|
.print("<img src=\"").print(fixUrl(rendering.href, true)).print("\" alt=\"").printEncoded(rendering.text).print("\"/></a>")
|
||||||
}
|
}
|
||||||
|
|
||||||
override protected def printLink(rendering: LinkRenderer.Rendering): Unit = {
|
override protected def printLink(rendering: LinkRenderer.Rendering): Unit = {
|
||||||
|
|||||||
Reference in New Issue
Block a user