From 54b1f0bd5e9bd4b17aea901c167a6c2c4fd6ef93 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sat, 2 Jun 2007 19:20:29 +0000 Subject: [PATCH] Fix failure to recognize images in description before images in link 2007-06-02 Michael Olson * lisp/muse-publish.el (muse-publish-classify-url): Docfix. (muse-publish-url): Recognize images in the description before images in the link. Fixes bug #5112. Thanks to Thomas Kappler for the suggested workaround. git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-330 --- ChangeLog | 7 +++++++ lisp/muse-publish.el | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc46356..31b632b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-06-02 Michael Olson + + * lisp/muse-publish.el (muse-publish-classify-url): Docfix. + (muse-publish-url): Recognize images in the description before + images in the link. Fixes bug #5112. Thanks to Thomas Kappler + for the suggested workaround. + 2007-05-31 Michael Olson * NEWS: Add example for setting `muse-html-table-attributes'. diff --git a/lisp/muse-publish.el b/lisp/muse-publish.el index 7ab5bed..b9f85b0 100644 --- a/lisp/muse-publish.el +++ b/lisp/muse-publish.el @@ -1457,8 +1457,8 @@ function for the list of available contexts." (defun muse-publish-classify-url (target) "Transform anchors and get published name, if TARGET is a page. -The return value is a cons cell. The car is the type of link, -the cadr is the page name, and the cddr is the anchor." +The return value is two linked cons cells. The car is the type +of link, the cadr is the page name, and the cddr is the anchor." (save-match-data (cond ((or (null target) (string= target "")) nil) @@ -1505,6 +1505,10 @@ the cadr is the page name, and the cddr is the anchor." (cddr target) 'url))) (cond ((eq type 'anchor-ref) (muse-markup-text 'anchor-ref anchor (or desc orig-url))) + ((and desc (string-match muse-image-regexp desc)) + (let ((ext (or (file-name-extension desc) ""))) + (setq desc (muse-path-sans-extension desc)) + (muse-markup-text 'image-link url desc ext))) ((string= url "") desc) ((eq type 'image) @@ -1517,10 +1521,6 @@ the cadr is the page name, and the cddr is the anchor." (muse-markup-text 'link-and-anchor url anchor (or desc orig-url) (muse-path-sans-extension url))) - ((and desc (string-match muse-image-regexp desc)) - (let ((ext (or (file-name-extension desc) ""))) - (setq desc (muse-path-sans-extension desc)) - (muse-markup-text 'image-link url desc ext))) ((eq type 'link) (muse-markup-text 'link url (or desc orig-url))) (t -- 2.11.4.GIT