From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: Images in div and p Date: Fri, 02 Oct 2009 01:16:58 +0200 Message-ID: <87ws3epuvp.fsf@gmx.de> References: <871vlneo7i.fsf@gmx.de> <87my4bcfps.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtUtW-0008Vq-Tf for emacs-orgmode@gnu.org; Thu, 01 Oct 2009 19:17:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtUtR-0008VW-Dy for emacs-orgmode@gnu.org; Thu, 01 Oct 2009 19:17:05 -0400 Received: from [199.232.76.173] (port=42142 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtUtR-0008VT-8f for emacs-orgmode@gnu.org; Thu, 01 Oct 2009 19:17:01 -0400 Received: from mail.gmx.net ([213.165.64.20]:56285) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MtUtQ-0004h5-Mg for emacs-orgmode@gnu.org; Thu, 01 Oct 2009 19:17:01 -0400 In-Reply-To: <87my4bcfps.fsf@gmx.de> (Sebastian Rose's message of "Thu, 01 Oct 2009 17:10:39 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Emacs-orgmode mailing list --=-=-= OK, this is my proposal (don't know, why I didn't send a patch in the first place...). If a caption is provided, wrap the image as before. If no caption is provided, just insert the image tag. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-html-div-if-caption.patch diff --git a/lisp/org-html.el b/lisp/org-html.el index 0e06919..a9adf30 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -1505,17 +1505,22 @@ lang=\"%s\" xml:lang=\"%s\"> (let* ((caption (org-find-text-property-in-string 'org-caption src)) (attr (org-find-text-property-in-string 'org-attributes src)) (label (org-find-text-property-in-string 'org-label src))) - (format "%s
-

%s -
%s" - (if org-par-open "

\n" "") - (if label (format "id=\"%s\" " label) "") + (concat + (if caption + (format "%s
+

" + (if org-par-open "

\n" "") + (if label (format "id=\"%s\" " label) ""))) + (format "" src (if (string-match "\\" caption "

") "") - (if org-par-open "\n

" "")))))) + (concat " " attr " alt=\"" src "\""))) + (if caption + (format "

%s +
%s" + (concat "\n

" caption "

") + (if org-par-open "\n

" "")))))))) (defun org-export-html-get-bibliography () "Find bibliography, cut it out and return it." --=-=-= A little Org-file for testing: #+OPTIONS: toc:nil #+MACRO: imageurl ./intranet/img/powered-by-mysql-167x86.png #+STYLE: * Images aligned #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="right" [[{{{imageurl}}}]] Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="left" [[{{{imageurl}}}]] Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo... * Images with Captions Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui #+CAPTION: My favourite image #+ATTR_HTML: alt="image" hspace="10" vspace="10" [[{{{imageurl}}}]] Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo... * Images in a row #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" [[{{{imageurl}}}]] #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" [[{{{imageurl}}}]] #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" [[{{{imageurl}}}]] #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" [[{{{imageurl}}}]] #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" [[{{{imageurl}}}]] #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" [[{{{imageurl}}}]] #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" [[{{{imageurl}}}]] #+ATTR_HTML: alt="image" hspace="10" vspace="10" align="absmiddle" [[{{{imageurl}}}]] --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--