markdown rendering exchanged
This commit is contained in:
Generated
+9
-9
@@ -1,6 +1,12 @@
|
|||||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||||
|
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
branch = "master"
|
||||||
|
name = "github.com/golang-commonmark/markdown"
|
||||||
|
packages = [".","byteutil","html","linkify"]
|
||||||
|
revision = "11a7a839e723aa293cccdc353b394dbfce7c131e"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/labstack/echo"
|
name = "github.com/labstack/echo"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
@@ -31,17 +37,11 @@
|
|||||||
revision = "ca5e3819723d8eeaf170ad510e7da1d6d2e94a08"
|
revision = "ca5e3819723d8eeaf170ad510e7da1d6d2e94a08"
|
||||||
version = "v1.2.0"
|
version = "v1.2.0"
|
||||||
|
|
||||||
[[projects]]
|
|
||||||
name = "github.com/russross/blackfriday"
|
|
||||||
packages = ["."]
|
|
||||||
revision = "cadec560ec52d93835bf2f15bd794700d3a2473b"
|
|
||||||
version = "v2.0.0"
|
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
name = "github.com/shurcooL/sanitized_anchor_name"
|
name = "github.com/opennota/urlesc"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "541ff5ee47f1dddf6a5281af78307d921524bcb5"
|
revision = "de5bf2ad457846296e2031421a34e2568e304e35"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
@@ -76,6 +76,6 @@
|
|||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "6cae41086ddec63b527c56e9e182bb69c9e1b50afa8d32f031516cd7b0d2e0e6"
|
inputs-digest = "82edf4a4585c9ad3318ead49e58d8bca7efed18e2f727be8e8fc6498972fc039"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
name = "github.com/labstack/echo"
|
name = "github.com/labstack/echo"
|
||||||
version = "3.1.0"
|
version = "3.1.0"
|
||||||
|
|
||||||
[[constraint]]
|
|
||||||
name = "github.com/russross/blackfriday"
|
|
||||||
version = "2.0.0"
|
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/mattn/go-sqlite3"
|
name = "github.com/mattn/go-sqlite3"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
|
|||||||
+4
-2
@@ -11,8 +11,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/golang-commonmark/markdown"
|
||||||
"github.com/labstack/echo"
|
"github.com/labstack/echo"
|
||||||
"github.com/russross/blackfriday"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -123,6 +123,8 @@ func load(c echo.Context, db *sql.DB) (Note, int) {
|
|||||||
return *n, http.StatusOK
|
return *n, http.StatusOK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var mdRenderer = markdown.New(markdown.HTML(true))
|
||||||
|
|
||||||
func mdTmplHTML(content []byte) template.HTML {
|
func mdTmplHTML(content []byte) template.HTML {
|
||||||
return template.HTML(string(blackfriday.Run(content)))
|
return template.HTML(mdRenderer.RenderToString(content))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user