1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-12-03 23:28:05 +00:00

Backlinks: Fix the bug

This commit is contained in:
Timur Ismagilov
2022-06-10 18:45:27 +03:00
parent c0495fbfcc
commit 9713c18b6b
13 changed files with 392 additions and 389 deletions

View File

@@ -3,6 +3,7 @@ package web
import (
"fmt"
"github.com/bouncepaw/mycomarkup/v5"
"github.com/bouncepaw/mycorrhiza/mycoopts"
"github.com/bouncepaw/mycorrhiza/viewutil"
"log"
"net/http"
@@ -208,7 +209,7 @@ func handlerUploadText(w http.ResponseWriter, rq *http.Request) {
}
if action == "Preview" {
ctx, _ := mycocontext.ContextFromStringInput(textData, shroom.MarkupOptions(hyphaName))
ctx, _ := mycocontext.ContextFromStringInput(textData, mycoopts.MarkupOptions(hyphaName))
util.HTTP200Page(
w,

View File

@@ -4,7 +4,7 @@ import (
"fmt"
"github.com/bouncepaw/mycomarkup/v5"
"github.com/bouncepaw/mycorrhiza/files"
"github.com/bouncepaw/mycorrhiza/shroom"
"github.com/bouncepaw/mycorrhiza/mycoopts"
"github.com/bouncepaw/mycorrhiza/viewutil"
"io"
"log"
@@ -124,7 +124,7 @@ func handlerRevision(w http.ResponseWriter, rq *http.Request) {
}
textContents, err = history.FileAtRevision(mycoFilePath, revHash)
if err == nil {
ctx, _ := mycocontext.ContextFromStringInput(textContents, shroom.MarkupOptions(hyphaName))
ctx, _ := mycocontext.ContextFromStringInput(textContents, mycoopts.MarkupOptions(hyphaName))
contents = mycomarkup.BlocksToHTML(ctx, mycomarkup.BlockTree(ctx))
}
@@ -196,7 +196,7 @@ func handlerHypha(w http.ResponseWriter, rq *http.Request) {
case hyphae.ExistingHypha:
fileContentsT, errT := os.ReadFile(h.TextFilePath())
if errT == nil {
ctx, _ := mycocontext.ContextFromStringInput(string(fileContentsT), shroom.MarkupOptions(hyphaName))
ctx, _ := mycocontext.ContextFromStringInput(string(fileContentsT), mycoopts.MarkupOptions(hyphaName))
getOpenGraph, descVisitor, imgVisitor := tools.OpenGraphVisitors(ctx)
ast := mycomarkup.BlockTree(ctx, descVisitor, imgVisitor)
contents = mycomarkup.BlocksToHTML(ctx, ast)
@@ -204,7 +204,7 @@ func handlerHypha(w http.ResponseWriter, rq *http.Request) {
}
switch h := h.(type) {
case *hyphae.MediaHypha:
contents = views.Media(h, lc) + contents
contents = mycoopts.Media(h, lc) + contents
}
util.HTTP200Page(w,