branch: externals/denote
commit b4bbff817c46d34e170dba007512810b83d8a8b3
Author: Peter Prevos <[email protected]>
Commit: Peter Prevos <[email protected]>
Also remove leading dash when sluggifying title.
---
denote.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/denote.el b/denote.el
index 2414a336c4..a0d825d488 100644
--- a/denote.el
+++ b/denote.el
@@ -403,9 +403,9 @@ things accordingly.")
(defun denote--slug-hyphenate (str)
"Replace spaces and underscores with hyphens in STR.
Also replace multiple hyphens with a single one and remove any
-trailing hyphen."
+leading and trailing hyphen."
(replace-regexp-in-string
- "-$" ""
+ "^-\\|-$" ""
(replace-regexp-in-string
"-\\{2,\\}" "-"
(replace-regexp-in-string "_\\|\s+" "-" str))))