1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-04 18:19:54 +00:00

Mycomarkup: Update to v4.3.2

All things interwiki

Backlinks from img and rockets are temporarily broken until all other blocks gain support of interwiki.
This commit is contained in:
Timur Ismagilov 2022-06-04 22:55:00 +03:00 committed by Timur Ismagilov
parent 4b9038c00b
commit 787882cb80
5 changed files with 13 additions and 11 deletions

4
go.mod
View File

@ -3,7 +3,7 @@ module github.com/bouncepaw/mycorrhiza
go 1.18
require (
github.com/bouncepaw/mycomarkup/v4 v4.3.0
github.com/bouncepaw/mycomarkup/v4 v4.3.2
github.com/go-ini/ini v1.63.2
github.com/gorilla/feeds v1.1.1
github.com/gorilla/mux v1.8.0
@ -23,7 +23,7 @@ require (
// Use this trick to test local Mycomarkup changes, replace the path with yours,
// but do not commit the change to the path:
replace github.com/bouncepaw/mycomarkup/v4 v4.3.0 => "/Users/bouncepaw/GolandProjects/mycomarkup"
// replace github.com/bouncepaw/mycomarkup/v4 v4.3.2 => "/Users/bouncepaw/GolandProjects/mycomarkup"
// Use this utility every time Mycomarkup gets a major update:
// https://github.com/marwan-at-work/mod

4
go.sum
View File

@ -1,7 +1,7 @@
github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/bouncepaw/mycomarkup/v4 v4.3.0 h1:Sj2spSzNbd/o5AKOi/Y/vRPpebaz5s9HOKP42UDA9Dg=
github.com/bouncepaw/mycomarkup/v4 v4.3.0/go.mod h1:y0b8U6Xfnh3KfNUpG3QuAXRJwqFPPpmS2kYvLzaf688=
github.com/bouncepaw/mycomarkup/v4 v4.3.2 h1:2t+7OACv1/ZAsd65A/thOtoJYGGa1shirZJPB4nLsrI=
github.com/bouncepaw/mycomarkup/v4 v4.3.2/go.mod h1:y0b8U6Xfnh3KfNUpG3QuAXRJwqFPPpmS2kYvLzaf688=
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.63.2 h1:kwN3umicd2HF3Tgvap4um1ZG52/WyKT9GGdPx0CJk6Y=

View File

@ -3,6 +3,7 @@ package interwiki
import (
"encoding/json"
"github.com/bouncepaw/mycomarkup/v4/options"
"github.com/bouncepaw/mycorrhiza/files"
"log"
"os"
@ -30,18 +31,18 @@ func Init() {
log.Printf("Loaded %d interwiki entries\n", len(theMap.list))
}
func HrefLinkFormatFor(prefix string) string {
func HrefLinkFormatFor(prefix string) (string, options.InterwikiError) {
if wiki, ok := theMap.byName[prefix]; ok {
return wiki.LinkHrefFormat
return wiki.LinkHrefFormat, options.Ok
}
return "{NAME}" // TODO: error
return "", options.UnknownPrefix
}
func ImgSrcFormatFor(prefix string) string {
func ImgSrcFormatFor(prefix string) (string, options.InterwikiError) {
if wiki, ok := theMap.byName[prefix]; ok {
return wiki.ImgSrcFormat
return wiki.ImgSrcFormat, options.Ok
}
return "{NAME}" // TODO: error
return "", options.UnknownPrefix
}
func readInterwiki() ([]Wiki, error) {

View File

@ -16,6 +16,7 @@ func MarkupOptions(hyphaName string) options.Options {
WebSiteURL: cfg.URL,
TransclusionSupported: true,
RedLinksSupported: true,
InterwikiSupported: true,
HyphaExists: func(hyphaName string) bool {
switch hyphae.ByName(hyphaName).(type) {
case *hyphae.EmptyHypha:

View File

@ -249,7 +249,7 @@ blockquote { border-left: 2px #999 solid; }
.wikilink_new:visited {color:#a55858;}
.navi-title { border-bottom: #eee 1px solid; }
.upload-amnt { border: #eee 1px solid; }
.prevnext { border-top: #eee 1px solid; }
.prevnext { border-top: #eee 1px solid; clear: both; }
td { border: #ddd 1px solid; }
.categories-card__link:hover,