diff --git a/WikiServer.go b/WikiServer.go
index acf8e92..2c0eba6 100644
--- a/WikiServer.go
+++ b/WikiServer.go
@@ -128,7 +128,7 @@ func (this *WikiServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
} else if remainingPath == "" {
- this.serveRedirect(w, this.opts.ExpectBaseURL+`view/`+url.QueryEscape(this.opts.DefaultPage))
+ this.serveRedirect(w, this.opts.ExpectBaseURL+`view/`+url.PathEscape(this.opts.DefaultPage))
return
} else if remainingPath == "random" {
@@ -139,11 +139,11 @@ func (this *WikiServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
chosenArticle := titles[rand.Intn(len(titles))]
- this.serveRedirect(w, this.opts.ExpectBaseURL+`view/`+url.QueryEscape(chosenArticle))
+ this.serveRedirect(w, this.opts.ExpectBaseURL+`view/`+url.PathEscape(chosenArticle))
return
} else if strings.HasPrefix(remainingPath, "view/") {
- articleTitle, err := url.QueryUnescape(remainingPath[len("view/"):])
+ articleTitle, err := url.PathUnescape(remainingPath[len("view/"):])
if err != nil {
this.serveErrorMessage(w, err)
return
@@ -152,7 +152,7 @@ func (this *WikiServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
} else if strings.HasPrefix(remainingPath, "modify/") {
- articleTitle, err := url.QueryUnescape(remainingPath[len("modify/"):])
+ articleTitle, err := url.PathUnescape(remainingPath[len("modify/"):])
if err != nil {
this.serveErrorMessage(w, err)
return
@@ -161,7 +161,7 @@ func (this *WikiServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
} else if strings.HasPrefix(remainingPath, "history/") {
- articleTitle, err := url.QueryUnescape(remainingPath[len("history/"):])
+ articleTitle, err := url.PathUnescape(remainingPath[len("history/"):])
if err != nil {
this.serveErrorMessage(w, err)
return
@@ -261,7 +261,7 @@ func (this *WikiServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
- this.serveRedirect(w, this.opts.ExpectBaseURL+`view/`+url.QueryEscape(title))
+ this.serveRedirect(w, this.opts.ExpectBaseURL+`view/`+url.PathEscape(title))
return
}
diff --git a/bbcode.go b/bbcode.go
index f0c7658..e7f1dc8 100644
--- a/bbcode.go
+++ b/bbcode.go
@@ -45,10 +45,10 @@ func (this *BBCodeRenderer) bbcode(data string) string {
pregReplaceRule{regexp.MustCompile(`(?si)\[\*\]`), `
`, nil},
pregReplaceRule{regexp.MustCompile(`(?si)\[url=(.*?)\](.*?)\[/url\]`), `$2`, nil},
pregReplaceRule{regexp.MustCompile(`(?si)\[article=(.*?)\](.*?)\[/article\]`), "", func(m []string) string {
- return `` + m[2] + ``
+ return `` + m[2] + ``
}},
pregReplaceRule{regexp.MustCompile(`(?si)\[rev=(.*?)\](.*?)\[/rev\]`), "", func(m []string) string {
- return `` + m[2] + ``
+ return `` + m[2] + ``
}},
pregReplaceRule{regexp.MustCompile(`(?si)\[imgur\](.*?)\.(...)\[/imgur\]`),
diff --git a/rArchive.go b/rArchive.go
index 756e0b1..c3a26e6 100644
--- a/rArchive.go
+++ b/rArchive.go
@@ -30,7 +30,7 @@ func (this *WikiServer) routeArchive(w http.ResponseWriter, r *http.Request, rev
``+
`You are viewing specific revision of this page, last modified `+
time.Unix(a.Modified, 0).In(this.loc).Format(this.opts.DateFormat)+`. `+
- `Click
here to see the latest revision.`+
+ `Click
here to see the latest revision.`+
`
`,
) + bcr.RenderHTML(string(a.Body))
pto.LoadCodeResources = bcr.CodePresent
diff --git a/rErrors.go b/rErrors.go
index ce9a259..7bde339 100644
--- a/rErrors.go
+++ b/rErrors.go
@@ -9,7 +9,7 @@ import (
)
func (this *WikiServer) noSuchArticleError(title string) template.HTML {
- return template.HTML(`No such article exists. Click here to create it.`)
+ return template.HTML(`No such article exists. Click here to create it.`)
}
func (this *WikiServer) serveErrorMessage(w http.ResponseWriter, message error) {
@@ -22,7 +22,7 @@ func (this *WikiServer) serveInternalError(w http.ResponseWriter, r *http.Reques
}
func (this *WikiServer) serveErrorHTMLMessage(w http.ResponseWriter, msg template.HTML) {
- this.serveRedirect(w, this.opts.ExpectBaseURL+"view/"+url.QueryEscape(this.opts.DefaultPage)+"?error="+url.QueryEscape(string(msg)))
+ this.serveRedirect(w, this.opts.ExpectBaseURL+"view/"+url.PathEscape(this.opts.DefaultPage)+"?error="+url.QueryEscape(string(msg)))
}
func (this *WikiServer) serveRedirect(w http.ResponseWriter, location string) {
@@ -46,5 +46,5 @@ func (this *WikiServer) formatTimestamp(m int64) string {
}
func (this *WikiServer) viewLink(articleTitle string) template.HTML {
- return template.HTML(`"` + template.HTMLEscapeString(articleTitle) + `"`)
+ return template.HTML(`"` + template.HTMLEscapeString(articleTitle) + `"`)
}
diff --git a/rHistory.go b/rHistory.go
index fb6fa5e..b3684f9 100644
--- a/rHistory.go
+++ b/rHistory.go
@@ -25,7 +25,7 @@ func (this *WikiServer) routeHistory(w http.ResponseWriter, r *http.Request, art
pto.CurrentPageIsArticle = true
content := `Page History
` +
- `There have been ` + fmt.Sprintf("%d", len(revs)) + ` edits to the page "` + template.HTMLEscapeString(articleTitle) + `".` +
+ `There have been ` + fmt.Sprintf("%d", len(revs)) + ` edits to the page "` + template.HTMLEscapeString(articleTitle) + `".` +
`
` +
`