diff --git a/controllers/book.go b/controllers/book.go index 06ce4044..c720cd02 100644 --- a/controllers/book.go +++ b/controllers/book.go @@ -22,6 +22,7 @@ import ( "github.com/lifei6671/mindoc/utils/pagination" "net/http" "github.com/lifei6671/mindoc/converter" + "github.com/russross/blackfriday" ) type BookController struct { @@ -76,6 +77,7 @@ func (c *BookController) Dashboard() { c.Abort("500") } + c.Data["Description"] = template.HTML(blackfriday.MarkdownBasic([]byte(book.Description))) c.Data["Model"] = *book } diff --git a/views/book/dashboard.tpl b/views/book/dashboard.tpl index 53be209d..2cf80260 100644 --- a/views/book/dashboard.tpl +++ b/views/book/dashboard.tpl @@ -92,7 +92,7 @@ 文档标签: {{.Model.Label}} -
{{.Model.Description}}
+
{{.Description}}