mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
Enables FENCED_CODE_BLOCKS in Markdown.
This commit is contained in:
@@ -27,7 +27,7 @@ object helpers {
|
|||||||
*/
|
*/
|
||||||
def markdown(value: String, repository: app.RepositoryInfo)(implicit context: app.Context): twirl.api.Html = {
|
def markdown(value: String, repository: app.RepositoryInfo)(implicit context: app.Context): twirl.api.Html = {
|
||||||
import org.pegdown._
|
import org.pegdown._
|
||||||
val html = new PegDownProcessor(Extensions.AUTOLINKS|Extensions.WIKILINKS)
|
val html = new PegDownProcessor(Extensions.AUTOLINKS|Extensions.WIKILINKS|Extensions.FENCED_CODE_BLOCKS)
|
||||||
.markdownToHtml(value, new LinkRenderer(){
|
.markdownToHtml(value, new LinkRenderer(){
|
||||||
override def render(node: WikiLinkNode): Rendering = {
|
override def render(node: WikiLinkNode): Rendering = {
|
||||||
try {
|
try {
|
||||||
@@ -53,7 +53,7 @@ object helpers {
|
|||||||
* Converts Markdown to HTML. This method does not support Wiki links.
|
* Converts Markdown to HTML. This method does not support Wiki links.
|
||||||
*/
|
*/
|
||||||
def markdown(value: String): twirl.api.Html = {
|
def markdown(value: String): twirl.api.Html = {
|
||||||
val html = new PegDownProcessor().markdownToHtml(value, new LinkRenderer())
|
val html = new PegDownProcessor(Extensions.FENCED_CODE_BLOCKS).markdownToHtml(value, new LinkRenderer())
|
||||||
twirl.api.Html(html)
|
twirl.api.Html(html)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user