Handle pathological case in post permalink generation (wincent.dev, e4136b1)

Handle case where the suggested permalink evaporates away to nothing due to the presence of illegal charactes and nothing else. There are actually two eventualities here: one where the record has never been saved and doesn't even have an id to fall back to (here we use the word "post" as a starting point); the other where the record does have an id and we can use that.

Signed-off-by: Greg Hurrell <greg@hurrell.net>

← Use non-greedy match when searching for a unique permalink (wincent.dev, 9abb465)
Auto-generation of blog post permalinks (wincent.dev, f71a66b) →

All snippets