aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-15 14:28:45 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-15 14:28:45 -0200
commit96e421160c5e682cedb8786b8a4bdbf59d7790d5 (patch)
tree6e59aff330997abaaf1eb2babdc4bf75b5becabb
parent028d30609b6109b682308c405b586e1eebe65972 (diff)
Add comment support on sx--link-to-data
-rw-r--r--sx.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/sx.el b/sx.el
index 950bbf0..ff481c1 100644
--- a/sx.el
+++ b/sx.el
@@ -93,6 +93,17 @@ with a `link' property)."
(let ((result (list (cons 'site_par (sx--site link)))))
;; Try to strip a question or answer ID
(when (or
+ ;; Comment
+ (and (string-match
+ ;; From inbox items
+ (rx "/posts/comments/"
+ ;; Comment ID
+ (group-n 1 (+ digit))
+ ;; Stuff at the end
+ (or (sequence (any "?#") (* any)) "")
+ string-end)
+ link)
+ (push '(type . comment) result))
;; Answer
(and (or (string-match
;; From 'Share' button