Fix WikiCanonicalFormNamespaceEsc
This commit is contained in:
parent
993b88ca4f
commit
c826297374
|
@ -21,6 +21,7 @@ import (
|
||||||
"html"
|
"html"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"unicode"
|
||||||
)
|
)
|
||||||
|
|
||||||
var DebugLevel int = 0
|
var DebugLevel int = 0
|
||||||
|
@ -152,7 +153,9 @@ func (namespaces Namespaces) WikiCanonicalFormNamespaceEsc(l string, defaultName
|
||||||
anchor = html.UnescapeString(anchor)
|
anchor = html.UnescapeString(anchor)
|
||||||
}
|
}
|
||||||
if len(article) > 0 {
|
if len(article) > 0 {
|
||||||
article = strings.ToUpper(article[0:1]) + article[1:]
|
runes := []rune(article)
|
||||||
|
runes[0] = unicode.ToUpper(runes[0])
|
||||||
|
article = string(runes)
|
||||||
}
|
}
|
||||||
return WikiLink{Namespace: namespace, PageName: article, Anchor: anchor}
|
return WikiLink{Namespace: namespace, PageName: article, Anchor: anchor}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue