org-publish-resolve-external-link: Fix links to non-Org files

* lisp/ox-publish.el: Do not try to call `org-at-heading-p' when not
in Org file.  `org-at-heading-p' and `org-entry-get' may err unless
inside Org buffer.
This commit is contained in:
Ihor Radchenko 2023-08-05 13:57:45 +03:00
parent 453c47b57d
commit 87b4de9617
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -1183,7 +1183,8 @@ references with `org-export-get-reference'."
(org-link-search search nil t)
(error
(signal 'org-link-broken (cdr err)))))
(and (org-at-heading-p)
(and (derived-mode-p 'org-mode)
(org-at-heading-p)
(org-string-nw-p (org-entry-get (point) "CUSTOM_ID"))))))))
((not org-publish-cache)
(progn