From 8e1dd6c43e8a358a85a8034825c475199bd2ffb7 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Wed, 6 May 2015 15:44:26 +0200 Subject: [PATCH] ox-html: Improve links with search * ox-html.el (org-html-link): Handle links with search when not using Publish. Reported-by: Rainer M Krug --- lisp/ox-html.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 6c712f6..0e69e6a 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -2849,12 +2849,18 @@ INFO is a plist holding contextual information. See ;; relative to a custom-id, a headline title a name, ;; a target or a radio-target. (let ((option (org-element-property :search-option link))) - (if (not option) raw-path - (concat raw-path - "#" - (org-publish-resolve-external-link - option - (org-element-property :path link)))))) + (cond ((and option org-publish-cache) + (concat raw-path + "#" + (org-publish-resolve-external-link + option + (org-element-property :path link)))) + ((and option (not org-publish-cache)) + (org-display-warning + (format "Link to file %s cannot be resolved. Please use Org Publish." + (org-element-property :path link))) + raw-path) + (t raw-path)))) (t raw-path))) ;; Extract attributes from parent's paragraph. HACK: Only do ;; this for the first link in parent (inner image link for -- 2.4.0