Skip to content

Commit

Permalink
Add more blacklisted characters in the slugify. I think there's proba…
Browse files Browse the repository at this point in the history
…bly an easier way to do this, like removing all non-word characters.
  • Loading branch information
nickoneill committed Feb 23, 2012
1 parent 9f6fc7b commit 6132b1f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ import (

var _ = os.Stdout

// const app_key = "ylg2zoaj78ol2dz"
// const app_secret = "i2863bf9odkbdl7"
const callback_url = "http://www.someurl.com/callback"
const callback_url = "http://www.someurl.com/callback"

var (
config Config
Expand Down Expand Up @@ -386,7 +384,7 @@ func slugify(orig string) string {

// TODO: remove wordlist
// replace invalid characters
noinvalid := regexp.MustCompile("[/'.]").ReplaceAll([]byte(orig), []byte(""))
noinvalid := regexp.MustCompile("[/'.?\"]").ReplaceAll([]byte(orig), []byte(""))
// replace spaces
sansspaces := regexp.MustCompile("[\\s]").ReplaceAll(noinvalid, []byte("-"))
// lowercase
Expand Down

0 comments on commit 6132b1f

Please sign in to comment.