diff options
author | Sean Allred <code@seanallred.com> | 2014-12-26 17:34:37 -0500 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-12-26 17:34:37 -0500 |
commit | 970acd6f7e5920ed6492a4a74e65eae9e29838b6 (patch) | |
tree | 732bc67d03226721844cec434504e51fa1141912 | |
parent | d732176007abdcc3395f7188dc918981d9ff2801 (diff) |
Add some explanatory comments
-rw-r--r-- | sx.el | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -328,19 +328,24 @@ If ALIST doesn't have a `site' property, one is created using the (defun sx--link-to-data (link) "Convert string LINK into data that can be displayed." (let ((result (list (cons 'site (sx--site link))))) + ;; Try to strip a question or answer ID (when (or ;; Answer (and (or (string-match + ;; From 'Share' button (rx "/a/" - ;; Answer ID + ;; Question ID (group (1+ digit)) - "/" - (1+ digit) + ;; User ID + "/" (1+ digit) + ;; Answer ID (group (or (sequence "#" (0+ any)) "")) string-end) link) (string-match + ;; From URL (rx "/questions/" (1+ digit) "/" (1+ (not (any "/"))) "/" + ;; User ID (group digit) (optional "/") (group (or (sequence "#" (0+ any)) "")) @@ -348,13 +353,19 @@ If ALIST doesn't have a `site' property, one is created using the (push '(type . answer) result)) ;; Question (and (or (string-match + ;; From 'Share' button (rx "/q/" - (group (1+ digit)) "/" - (1+ digit) + ;; Question ID + (group (1+ digit)) + ;; User ID + "/" (1+ digit) + ;; Answer or Comment ID (group (or (sequence "#" (0+ any)) "")) string-end) link) (string-match + ;; From URL (rx "/questions/" + ;; Question ID (group (1+ digit)) "/") link)) (push '(type . question) result))) |