emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote b4bbff817c 1/2: Also remove leading dash when sl


From: ELPA Syncer
Subject: [elpa] externals/denote b4bbff817c 1/2: Also remove leading dash when sluggifying title.
Date: Sat, 20 Aug 2022 22:57:28 -0400 (EDT)

branch: externals/denote
commit b4bbff817c46d34e170dba007512810b83d8a8b3
Author: Peter Prevos <peter@prevos.net>
Commit: Peter Prevos <peter@prevos.net>

    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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]