From 725257ca3d7d52c8e4e67fd8bdd557a949792daa Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Sat, 13 Dec 2014 22:05:13 -0700 Subject: [PATCH] Removes leading 'b' on slugs in Python 3 --- jrnl/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jrnl/util.py b/jrnl/util.py index c6ea4659..5f0571cf 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -146,6 +146,8 @@ def slugify(string): """ string = u(string) ascii_string = str(unicodedata.normalize('NFKD', string).encode('ascii', 'ignore')) + if PY3: + ascii_string = ascii_string[1:] # removed the leading 'b' no_punctuation = re.sub(r'[^\w\s-]', '', ascii_string).strip().lower() slug = re.sub(r'[-\s]+', '-', no_punctuation) return u(slug)