1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-11-04 01:23:02 +00:00

Migrate to mycomarkup v0.3.3

Some things got fixed:
* OpenGraph is (mostly) back
* RocketLink display text is back

But:
* All links are blue, but only some of they should be
This commit is contained in:
Timur Ismagilov
2021-05-24 23:19:05 +05:00
parent 4fcf5abb37
commit ec1eafc0e4
3 changed files with 9 additions and 5 deletions

View File

@@ -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