1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-05 02:29:54 +00:00

Interwiki: Make prefices behave like hypha names

I/e case-insensitive, among other things
This commit is contained in:
Timur Ismagilov 2022-06-14 22:26:13 +03:00
parent ba54369096
commit 322b0603fb
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"encoding/json"
"github.com/bouncepaw/mycomarkup/v5/options"
"github.com/bouncepaw/mycorrhiza/files"
"github.com/bouncepaw/mycorrhiza/util"
"log"
"os"
)
@ -32,6 +33,7 @@ func Init() {
}
func HrefLinkFormatFor(prefix string) (string, options.InterwikiError) {
prefix = util.CanonicalName(prefix)
if wiki, ok := theMap.byName[prefix]; ok {
return wiki.LinkHrefFormat, options.Ok
}
@ -39,6 +41,7 @@ func HrefLinkFormatFor(prefix string) (string, options.InterwikiError) {
}
func ImgSrcFormatFor(prefix string) (string, options.InterwikiError) {
prefix = util.CanonicalName(prefix)
if wiki, ok := theMap.byName[prefix]; ok {
return wiki.ImgSrcFormat, options.Ok
}

View File

@ -1 +0,0 @@
package shroom