mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-10-30 03:36:16 +00:00
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"
|
||||
"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
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
package shroom
|
Loading…
Reference in New Issue
Block a user