diff --git a/org-web-tools.el b/org-web-tools.el index 06524c2..59ecf1c 100644 --- a/org-web-tools.el +++ b/org-web-tools.el @@ -287,17 +287,17 @@ current entry (i.e. this does not look deeper in the subtree, nor outside of it) will be converted." (interactive) (cl-flet ((prev-url (entry-beg) - ;; Work from the bottom of the list to the top, makes it simpler - (when (re-search-backward (rx "http" (optional "s") "://" (1+ (not (any space)))) entry-beg 'no-error) - ;; Found link; see if it's an Org link - (beginning-of-line) - (if (re-search-forward org-bracket-link-analytic-regexp (line-end-position) 'noerror) - ;; Org link - (list ;; Reconstruct link from regexp groups - (concat (match-string 1) (match-string 3)) - (match-beginning 0)) - ;; Plain link - (list (match-string 0) (match-beginning 0)))))) + ;; Work from the bottom of the list to the top, makes it simpler + (when (re-search-backward (rx "http" (optional "s") "://" (1+ (not (any space)))) entry-beg 'no-error) + ;; Found link; see if it's an Org link + (beginning-of-line) + (if (re-search-forward org-link-bracket-re (line-end-position) 'noerror) + ;; Org link + (list ;; Reconstruct link from regexp groups + (concat (match-string 1) (match-string 3)) + (match-beginning 0)) + ;; Plain link + (list (match-string 0) (match-beginning 0)))))) (let ((level (1+ (org-outline-level))) (entry-beg (org-entry-beginning-position))) (goto-char (org-entry-end-position))