aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sx-interaction.el2
-rw-r--r--sx.el7
2 files changed, 2 insertions, 7 deletions
diff --git a/sx-interaction.el b/sx-interaction.el
index 75b51ab..3d60cbe 100644
--- a/sx-interaction.el
+++ b/sx-interaction.el
@@ -138,7 +138,7 @@ Element can be a question, answer, or comment."
(list (read-string (concat "Link (" def "): ") nil nil def))))
;; For now, we have no chance of handling chat links, let's just
;; send them to the browser.
- (if (string-match (rx string-start "http" (opt "s") "://chat."))
+ (if (string-match (rx string-start "http" (opt "s") "://chat.") link)
(sx-visit-externally link)
(let ((data (sx--link-to-data link)))
(sx-assoc-let data
diff --git a/sx.el b/sx.el
index e0609a7..26151b3 100644
--- a/sx.el
+++ b/sx.el
@@ -148,12 +148,7 @@ with a `link' property)."
;; From URL
(string-match (rx "/questions/"
;; Question ID
- (group-n 1 (+ digit)) "/"
- ;; Optional question title
- (optional (+ (not (any "/"))) "/")
- ;; Garbage at the end
- (optional (and (any "?#") (* any)))
- string-end)
+ (group-n 1 (+ digit)) "/")
link))
(push '(type . question) result)))
(push (cons 'id (string-to-number (match-string-no-properties 1 link)))