diff options
author | Sean Allred <code@seanallred.com> | 2014-11-25 22:39:52 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-11-25 22:39:52 -0500 |
commit | 026f8f42a124da1dcc0a7254e49e2cf787b82fe1 (patch) | |
tree | 627ec95a948d7a71b5494b745b5a66d41e6116ca | |
parent | 07a1456fe7a91d1589f689d40ac4391f35e695b9 (diff) |
Remove whitespace for effective at-mentions
If the display name contained whitespace, the function would keep the
whitespace in the at-mention. According to observed behavior on the
website, this is not correct.
This commit removes all whitespace from the returned display name in the
appropriate function.
-rw-r--r-- | sx.el | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -199,10 +199,13 @@ Return the result of BODY." result)) (defun sx--user-@name (user) - "Get the `display_name' of USER prepended with @." + "Get the `display_name' of USER prepended with @. +In order to correctly @mention the user, all whitespace is +removed from the display name before it is returned." (sx-assoc-let user (when (stringp .display_name) - (concat "@" .display_name)))) + (concat "@" (replace-regexp-in-string + "[[:space:]]" "" .display_name))))) ;;; Assoc-let |