diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index f9c3877d7..cff34f058 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -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