diff --git a/go.mod b/go.mod index ed833b5..6ee2068 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.14 require ( git.sr.ht/~adnano/go-gemini v0.1.13 github.com/adrg/xdg v0.2.2 - github.com/bouncepaw/mycomarkup v0.3.1 + github.com/bouncepaw/mycomarkup v0.3.3 github.com/go-ini/ini v1.62.0 github.com/gorilla/feeds v1.1.1 github.com/kr/pretty v0.2.1 // indirect diff --git a/go.sum b/go.sum index d74a34a..385cb76 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ git.sr.ht/~adnano/go-gemini v0.1.13/go.mod h1:If1VxEWcZDrRt5FeAFnGTcM2Ud1E3BXs3V github.com/adrg/xdg v0.2.2 h1:A7ZHKRz5KGOLJX/bg7IPzStryhvCzAE1wX+KWawPiAo= github.com/adrg/xdg v0.2.2/go.mod h1:7I2hH/IT30IsupOpKZ5ue7/qNi3CoKzD6tL3HwpaRMQ= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/bouncepaw/mycomarkup v0.3.1 h1:5uh7PJYjTNqrA2ibZAvA50nImKECq5AWtlzTEOO32sM= -github.com/bouncepaw/mycomarkup v0.3.1/go.mod h1:0n6thlGGgrx2Y/2NaaUH4qHW4v1xJ+EpW7yMFUxNRIg= +github.com/bouncepaw/mycomarkup v0.3.3 h1:Mw26iJsxtIgGR0yuMrgyHEj14VchetCdDvqGlj+m4OE= +github.com/bouncepaw/mycomarkup v0.3.3/go.mod h1:0n6thlGGgrx2Y/2NaaUH4qHW4v1xJ+EpW7yMFUxNRIg= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-ini/ini v1.62.0 h1:7VJT/ZXjzqSrvtraFp4ONq80hTcRQth1c9ZnQ3uNQvU= diff --git a/web/readers.go b/web/readers.go index 0e04e11..5fb97bd 100644 --- a/web/readers.go +++ b/web/readers.go @@ -2,7 +2,9 @@ package web import ( "fmt" + "github.com/bouncepaw/mycomarkup" "github.com/bouncepaw/mycomarkup/doc" + "github.com/bouncepaw/mycomarkup/parser" "io/ioutil" "log" "net/http" @@ -122,9 +124,11 @@ func handlerHypha(w http.ResponseWriter, rq *http.Request) { fileContentsT, errT := ioutil.ReadFile(h.TextPath) _, errB := os.Stat(h.BinaryPath) if errT == nil { + ctx, _ := parser.ContextFromStringInput(hyphaName, "") // FIXME: md := doc.Doc(hyphaName, string(fileContentsT)) - contents = md.AsHTML() - //openGraph = md.OpenGraphHTML() + ast := md.Lex() + contents = doc.GenerateHTML(ast, 0) + openGraph = mycomarkup.OpenGraphHTML(ctx, ast) } if !os.IsNotExist(errB) { contents = views.AttachmentHTML(h) + contents