Check for hyphen in dehyphen before calling str/replace

This commit is contained in:
Oleksandr Yakushev 2025-01-08 17:52:29 +02:00
parent 8e0d6984bd
commit 3ecac63bea

View file

@ -227,7 +227,8 @@
Hyphens at the start or end of a string should not be touched."
[s]
(str/replace s #"(\w)-(?=\w)" "$1 "))
(cond-> s
(str/includes? s "-") (str/replace #"(\w)-(?=\w)" "$1 ")))
(defn- namespace-_
"Return the namespace portion of a symbol, with dashes converted."