aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-15 14:48:12 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-15 14:48:12 +0100
commit2cc11e4dd5b77c97922663ac9e4df4d48e77dcde (patch)
tree5b08d29f962fb0b99e50e4686f3c1263e6ec0e74 /lisp
parenta2bcbb47f32abcfae496a8d0aa27ec8a59101c60 (diff)
only propertize handles and tags if they are bounded by non-words
fixes accidental propertizing of handles in links
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-toot.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 02dc075..438e887 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -1262,10 +1262,10 @@ Added to `after-change-functions'."
;; stops all text after a handle or mention being propertized:
(set-text-properties (cdr header-region) (point-max) nil)
;; TODO: confirm allowed hashtag/handle characters:
- (mastodon-toot--propertize-item "#[1-9a-zA-Z_]+"
+ (mastodon-toot--propertize-item "[\n\t ]\\(?2:#[1-9a-zA-Z_]+\\)[\n\t ]"
'success
(cdr header-region))
- (mastodon-toot--propertize-item "@[1-9a-zA-Z._-]+"
+ (mastodon-toot--propertize-item "[\n\t ]\\(?2:@[1-9a-zA-Z._-]+\\)[\n\t ]"
'mastodon-display-name-face
(cdr header-region)))))
@@ -1274,8 +1274,8 @@ Added to `after-change-functions'."
(save-excursion
(goto-char start)
(cl-loop while (search-forward-regexp regex nil :noerror)
- do (add-text-properties (match-beginning 0)
- (match-end 0)
+ do (add-text-properties (match-beginning 2)
+ (match-end 2)
`(face ,face)))))
(defun mastodon-toot-compose-buffer-p ()