v0.0
This commit is contained in:
0
server/create.go
Normal file → Executable file
0
server/create.go
Normal file → Executable file
0
server/create_test.go
Normal file → Executable file
0
server/create_test.go
Normal file → Executable file
@@ -7,12 +7,18 @@ import (
|
||||
"path"
|
||||
|
||||
"github.com/gomarkdown/markdown"
|
||||
"github.com/gomarkdown/markdown/html"
|
||||
"github.com/gomarkdown/markdown/parser"
|
||||
)
|
||||
|
||||
func notesFile(p Path, w http.ResponseWriter, r *http.Request) {
|
||||
b, _ := ioutil.ReadFile(p.Local)
|
||||
notesFileHead(p, w)
|
||||
content := markdown.ToHTML(b, nil, nil)
|
||||
renderer := html.NewRenderer(html.RendererOptions{
|
||||
Flags: html.CommonFlags | html.TOC,
|
||||
})
|
||||
parser := parser.NewWithExtensions(parser.CommonExtensions | parser.HeadingIDs | parser.AutoHeadingIDs | parser.Titleblock)
|
||||
content := markdown.ToHTML(b, parser, renderer)
|
||||
fmt.Fprintf(w, "%s\n", content)
|
||||
}
|
||||
|
||||
|
||||
0
server/submit.go
Normal file → Executable file
0
server/submit.go
Normal file → Executable file
0
server/submit_test.go
Normal file → Executable file
0
server/submit_test.go
Normal file → Executable file
Reference in New Issue
Block a user