From c8262973742b299fd9018d8722576ba6acae150a Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Thu, 10 Feb 2022 19:02:57 +0100 Subject: [PATCH] Fix WikiCanonicalFormNamespaceEsc --- gowiki.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gowiki.go b/gowiki.go index 60b68ca..e80d9a9 100644 --- a/gowiki.go +++ b/gowiki.go @@ -21,6 +21,7 @@ import ( "html" "regexp" "strings" + "unicode" ) var DebugLevel int = 0 @@ -152,7 +153,9 @@ func (namespaces Namespaces) WikiCanonicalFormNamespaceEsc(l string, defaultName anchor = html.UnescapeString(anchor) } 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} }