Interwiki: Make prefices behave like hypha names
I/e case-insensitive, among other things
This commit is contained in:
parent
ba54369096
commit
322b0603fb
@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/bouncepaw/mycomarkup/v5/options"
|
"github.com/bouncepaw/mycomarkup/v5/options"
|
||||||
"github.com/bouncepaw/mycorrhiza/files"
|
"github.com/bouncepaw/mycorrhiza/files"
|
||||||
|
"github.com/bouncepaw/mycorrhiza/util"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
@ -32,6 +33,7 @@ func Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func HrefLinkFormatFor(prefix string) (string, options.InterwikiError) {
|
func HrefLinkFormatFor(prefix string) (string, options.InterwikiError) {
|
||||||
|
prefix = util.CanonicalName(prefix)
|
||||||
if wiki, ok := theMap.byName[prefix]; ok {
|
if wiki, ok := theMap.byName[prefix]; ok {
|
||||||
return wiki.LinkHrefFormat, options.Ok
|
return wiki.LinkHrefFormat, options.Ok
|
||||||
}
|
}
|
||||||
@ -39,6 +41,7 @@ func HrefLinkFormatFor(prefix string) (string, options.InterwikiError) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ImgSrcFormatFor(prefix string) (string, options.InterwikiError) {
|
func ImgSrcFormatFor(prefix string) (string, options.InterwikiError) {
|
||||||
|
prefix = util.CanonicalName(prefix)
|
||||||
if wiki, ok := theMap.byName[prefix]; ok {
|
if wiki, ok := theMap.byName[prefix]; ok {
|
||||||
return wiki.ImgSrcFormat, options.Ok
|
return wiki.ImgSrcFormat, options.Ok
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
package shroom
|
|
||||||
Loading…
Reference in New Issue
Block a user