Merge pull request #75 from lukasepple/master

error handling in slugify
This commit is contained in:
Javier Olaechea 2014-12-10 12:15:57 -05:00
commit 66928295e3

View file

@ -39,7 +39,11 @@
(defun slugify (string)
"Return a version of STRING suitable for use as a URL."
(remove-if-not #'slug-char-p (substitute-if #\- #'unicode-space-p string)))
(let ((slugified (remove-if-not #'slug-char-p
(substitute-if #\- #'unicode-space-p string))))
(if (zerop (length slugified))
(error "Post title '~a' does not contain characters suitable for a slug!" string
slugified)))
;; Content Types