Small fix.

This commit is contained in:
takezoe
2013-09-23 02:14:31 +09:00
parent d34118bdfd
commit d53619c247
2 changed files with 6 additions and 9 deletions

View File

@@ -52,7 +52,7 @@ class GitBucketLinkRender(context: app.Context, repository: service.RepositorySe
} }
class GitBucketVerbatimSerializer extends VerbatimSerializer { class GitBucketVerbatimSerializer extends VerbatimSerializer {
def serialize(node: VerbatimNode, printer: Printer) { def serialize(node: VerbatimNode, printer: Printer): Unit = {
printer.println.print("<pre") printer.println.print("<pre")
if (!StringUtils.isEmpty(node.getType)) { if (!StringUtils.isEmpty(node.getType)) {
printer.print(" class=").print('"').print("prettyprint ").print(node.getType).print('"') printer.print(" class=").print('"').print("prettyprint ").print(node.getType).print('"')
@@ -98,11 +98,11 @@ class GitBucketHtmlSerializer(
} }
} }
private def printAttribute(name: String, value: String) { private def printAttribute(name: String, value: String): Unit = {
printer.print(' ').print(name).print('=').print('"').print(value).print('"') printer.print(' ').print(name).print('=').print('"').print(value).print('"')
} }
override def visit(node: TextNode) { override def visit(node: TextNode): Unit = {
// convert commit id and username to link. // convert commit id and username to link.
val text = if(enableRefsLink) convertRefsLinks(node.getText, repository, "issue:") else node.getText val text = if(enableRefsLink) convertRefsLinks(node.getText, repository, "issue:") else node.getText

View File

@@ -31,9 +31,8 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
* Converts Markdown of Wiki pages to HTML. * Converts Markdown of Wiki pages to HTML.
*/ */
def markdown(value: String, repository: service.RepositoryService.RepositoryInfo, def markdown(value: String, repository: service.RepositoryService.RepositoryInfo,
enableWikiLink: Boolean, enableRefsLink: Boolean)(implicit context: app.Context): Html = { enableWikiLink: Boolean, enableRefsLink: Boolean)(implicit context: app.Context): Html =
Html(Markdown.toHtml(value, repository, enableWikiLink, enableRefsLink)) Html(Markdown.toHtml(value, repository, enableWikiLink, enableRefsLink))
}
/** /**
* Returns &lt;img&gt; which displays the avatar icon. * Returns &lt;img&gt; which displays the avatar icon.
@@ -81,14 +80,12 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
/** /**
* Generates the url to the account page. * Generates the url to the account page.
*/ */
def url(userName: String)(implicit context: app.Context): String = def url(userName: String)(implicit context: app.Context): String = s"${context.path}/${userName}"
s"${context.path}/${userName}"
/** /**
* Returns the url to the root of assets. * Returns the url to the root of assets.
*/ */
def assets(implicit context: app.Context): String = def assets(implicit context: app.Context): String = s"${context.path}/assets"
s"${context.path}/assets"
def isPast(date: Date): Boolean = System.currentTimeMillis > date.getTime def isPast(date: Date): Boolean = System.currentTimeMillis > date.getTime