Merge pull request #75 from lukasepple/master
error handling in slugify
This commit is contained in:
commit
66928295e3
1 changed files with 5 additions and 1 deletions
|
@ -39,7 +39,11 @@
|
||||||
|
|
||||||
(defun slugify (string)
|
(defun slugify (string)
|
||||||
"Return a version of STRING suitable for use as a URL."
|
"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
|
;; Content Types
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue