diff --git a/lisp/org.el b/lisp/org.el index ef0bc3f24..a1b9b0bdf 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -6179,17 +6179,13 @@ targets." The regular expression finds the targets also if there is a line break between words." (and targets - (concat - "\\_<\\(" - (mapconcat - (lambda (x) - (setq x (regexp-quote x)) - (while (string-match " +" x) - (setq x (replace-match "\\s-+" t t x))) - x) - targets - "\\|") - "\\)\\_>"))) + (concat "\\(" + (mapconcat + (lambda (x) + (replace-regexp-in-string " +" "\\s-+" (regexp-quote x) t t)) + targets + "\\|") + "\\)"))) (defun org-activate-tags (limit) (if (re-search-forward (org-re "^\\*+.*[ \t]\\(:[[:alnum:]_@#%:]+:\\)[ \r\n]") limit t) diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index ad8eb329d..f60678e8d 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -1169,7 +1169,9 @@ the file including them will be republished as well." (let* ((element (org-element-at-point)) (included-file (and (eq (org-element-type element) 'keyword) - (org-string-nw-p (org-element-property :value element))))) + (string-match "^\\(\".+?\"\\|\\S-+\\)" + (org-element-property :value element)) + (org-remove-double-quotes (match-string 1))))) (when included-file (add-to-list 'included-files-ctime (org-publish-cache-ctime-of-src diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index b0778ff8b..fe20496a1 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -2042,6 +2042,15 @@ Another text. (ref:text) (org-export-resolve-radio-link (org-element-map tree 'link 'identity info t) info)))) + ;; Radio link next to an apostrophe. + (should + (org-test-with-temp-text "<<>> radio's" + (org-update-radio-target-regexp) + (let* ((tree (org-element-parse-buffer)) + (info `(:parse-tree ,tree))) + (org-export-resolve-radio-link + (org-element-map tree 'link 'identity info t) + info)))) ;; Multiple radio targets. (should (equal '("radio1" "radio2")