branch: externals/denote commit 8eea59281a699767409697e63f74d12f1d8e2563 Merge: bef859aea1 b4bbff817c Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: GitHub <nore...@github.com>
Merge pull request #99 from pprevos/main 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))))