aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-05-08 09:29:25 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-05-08 09:29:25 +0200
commit8db980e433bce0307802663379b84acb51051200 (patch)
tree614b10d9c7267cb8ab127b8dde76aa81e7d094eb
parent96fcaaa8d45eeec63199ac7cc11689dabdec08ee (diff)
count chars: use mastodon-toot-handle-regex
-rw-r--r--lisp/mastodon-toot.el5
1 files changed, 1 insertions, 4 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 3fd445c..3d8c1f3 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1539,10 +1539,7 @@ CW is the content warning, which contributes to the character count."
(replace-match "xxxxxxxxxxxxxxxxxxxxxxx")) ; 23 x's
;; handle @handles
(goto-char (point-min))
- (while (search-forward-regexp (concat "\\(?2:@[^ @\n]+\\)" ; a handle only
- "\\(@[^ \n]+\\)?" ; with poss domain
- "\\b")
- nil t)
+ (while (search-forward-regexp mastodon-toot-handle-regex nil t)
(replace-match (match-string 2))) ; replace with handle only
(+ (length cw)
(length (buffer-substring (point-min) (point-max))))))