Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Need to escape + in titles as well.

  • Loading branch information...
commit e6209b23e95c702994ace474fd2e7099024127fe 1 parent 18bf39e
@dustin authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 tools/couchload/couchload.go
View
7 tools/couchload/couchload.go
@@ -38,8 +38,9 @@ type Article struct {
Geo *Geo `json:"geo,omitempty"`
}
-func escapeslash(in string) string {
- return strings.Replace(in, "/", "%2f", -1)
+func escapeTitle(in string) string {
+ return strings.Replace(strings.Replace(in, "/", "%2f", -1),
+ "+", "%2b", -1)
}
func resolveConflict(db *couch.Database, a *Article) {
@@ -78,7 +79,7 @@ func doPage(db *couch.Database, p *wikiparse.Page) {
article.RevInfo.ContributorId = p.Revision.Contributor.ID
article.RevInfo.Comment = p.Revision.Comment
article.Text = p.Revision.Text
- article.ID = escapeslash(p.Title)
+ article.ID = escapeTitle(p.Title)
_, _, err = db.Insert(&article)
httpe, isHttpError := err.(*couch.HttpError)
Please sign in to comment.
Something went wrong with that request. Please try again.