mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-10-18 01:07:41 +00:00
Interwiki: Make prefices behave like hypha names
I/e case-insensitive, among other things
This commit is contained in:
@@ -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
|
|
Reference in New Issue
Block a user