mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 21:45:50 +01:00
Convert Markdown to HTML in the view by view.helpers.markdown().
This commit is contained in:
@@ -213,9 +213,7 @@ class RepositoryViewerController extends ControllerBase {
|
|||||||
|
|
||||||
// process README.md
|
// process README.md
|
||||||
val readme = files.find(_.name == "README.md").map { file =>
|
val readme = files.find(_.name == "README.md").map { file =>
|
||||||
import org.pegdown._
|
new String(JGitUtil.getContent(Git.open(getRepositoryDir(owner, repository)), file.id, true).get, "UTF-8")
|
||||||
val git = Git.open(getRepositoryDir(owner, repository))
|
|
||||||
new PegDownProcessor().markdownToHtml(new String(git.getRepository.open(file.id).getBytes, "UTF-8"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html.files(
|
html.files(
|
||||||
|
|||||||
@@ -52,10 +52,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
@readme.map { html =>
|
@readme.map { content =>
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<tr>
|
<tr>
|
||||||
<td>@Html(html)</td>
|
<td>@helpers.markdown(content)</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user