Browse Source

fix another bug in slugify

Oz N Tiram 9 years ago
parent
commit
af35dd70fe
2 changed files with 4 additions and 1 deletions
  1. 1 1
      blogit/blogit.py
  2. 3 0
      tests/test_all.py

+ 1 - 1
blogit/blogit.py

@@ -99,7 +99,7 @@ class Tag(object):
     def slug(self):
         _slug = self.name.lower()
         _slug = re.sub(r'[;:,. ]+', '-', _slug.lstrip(',.;:-'))
-        return _slug
+        return _slug.lstrip('-')
 
     @property
     def posts(self):

+ 3 - 0
tests/test_all.py

@@ -268,3 +268,6 @@ def test_build():
     with open(os.path.join(CONFIG['output_to'], 'archive', 'index.html')) as html_index:
         soup = BeautifulSoup(html_index.read(), 'html.parser')
         assert len(soup.find_all(class_='post')) == 12
+
+    # todo, check tag pages
+    # tag pages are not built properly