1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-01-07 10:20:26 +00:00

Migrate to Mycomarkup v0.5.0

Found out that the system that generates OpenGraph does not take binary hyphae's image attachments into account. Gotta fix that, perhaps.

Also red links are still not fixed.

Also, nested links do not work as intended in some cases.

What exactly did v0.5.0 improve?
This commit is contained in:
Timur Ismagilov 2021-06-12 14:42:00 +05:00
parent 8bd00c7f37
commit e1f6a64ace
3 changed files with 8 additions and 5 deletions

2
go.mod
View File

@ -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.4.6
github.com/bouncepaw/mycomarkup v0.5.0
github.com/go-ini/ini v1.62.0
github.com/gorilla/feeds v1.1.1
github.com/kr/pretty v0.2.1 // indirect

4
go.sum
View File

@ -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.4.6 h1:XxTD+ryAUSGTsd3Zr8Jn7HFy94Tpv+bEuKLnrjdb9QY=
github.com/bouncepaw/mycomarkup v0.4.6/go.mod h1:0n6thlGGgrx2Y/2NaaUH4qHW4v1xJ+EpW7yMFUxNRIg=
github.com/bouncepaw/mycomarkup v0.5.0 h1:hquQS1Du9LTBRRmHwsQ74Gxktu4Tn6Sz8uP4e6LVfFI=
github.com/bouncepaw/mycomarkup v0.5.0/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=

View File

@ -3,6 +3,7 @@ package web
import (
"fmt"
"github.com/bouncepaw/mycomarkup/mycocontext"
"github.com/bouncepaw/mycorrhiza/cfg"
"io/ioutil"
"log"
"net/http"
@ -126,9 +127,11 @@ func handlerHypha(w http.ResponseWriter, rq *http.Request) {
_, errB := os.Stat(h.BinaryPath)
if errT == nil {
ctx, _ := mycocontext.ContextFromStringInput(hyphaName, string(fileContentsT))
ast := mycomarkup.BlockTree(ctx)
ctx = mycocontext.WithWebSiteURL(ctx, cfg.URL)
getOpenGraph, descVisitor, imgVisitor := mycomarkup.OpenGraphVisitors(ctx)
ast := mycomarkup.BlockTree(ctx, descVisitor, imgVisitor)
contents = mycomarkup.BlocksToHTML(ctx, ast)
openGraph = mycomarkup.OpenGraphHTML(ctx, ast)
openGraph = getOpenGraph()
}
if !os.IsNotExist(errB) {
contents = views.AttachmentHTML(h) + contents