Skip to content

Commit dbb7b04

Browse files
bcc32alphapapa
authored andcommitted
Fix: (-org-add-link) Handle links that span lines
Links can often span a line break, especially when the paragraph containing them has been folded. Allow the detection of these links by scanning a bit around the line at point.
1 parent 4030caf commit dbb7b04

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

README.org

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ These special keywords can be used when searching:
120120
**** Fixes
121121

122122
- Handle null or blank URLs returned by Pocket. (Fixes [[https://github.com/alphapapa/pocket-reader.el/issues/19][#19]], [[https://github.com/alphapapa/pocket-reader.el/issues/20][#20]]. Thanks to [[https://github.com/bcc32][Aaron Zeng]].)
123+
- Handle links in Org buffers that span lines. (Thanks to [[https://github.com/bcc32][Aaron Zeng]].)
123124

124125
*** 0.2
125126

pocket-reader.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ eww, elfeed, and Org."
12301230
(defun pocket-reader-org-add-link ()
12311231
"Add link at point to Pocket in Org buffers."
12321232
(interactive)
1233-
(when-let ((url (when (org-in-regexp org-bracket-link-regexp)
1233+
(when-let ((url (when (org-in-regexp org-bracket-link-regexp 1)
12341234
(org-link-unescape (match-string-no-properties 1)))))
12351235
(when (pocket-lib-add-urls url)
12361236
(message "Added: %s" url))))

0 commit comments

Comments
 (0)