From a9618e4e454fceb526497b1d0698d1d8ec3cc2b5 Mon Sep 17 00:00:00 2001
From: Carsten Dominik
Date: Mon, 2 Feb 2009 12:08:23 +0100
Subject: [PATCH] Export: Fix XHTML validity problem with figure divs
---
lisp/ChangeLog | 7 +++++++
lisp/org-exp.el | 17 +++++++++++------
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 34c57310e..49f6fdc45 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-02 Carsten Dominik
+
+ * org-exp.el (org-export-html-format-image): New argument
+ PAR-OPEN.
+ (org-export-as-html): Pass par-open to
+ `org-export-html-format-image'.
+
2009-02-01 Carsten Dominik
* org.el (org-yank-adjusted-subtrees, org-return-follows-link)
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 7e51821b6..da6ffbd14 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -3625,7 +3625,7 @@ lang=\"%s\" xml:lang=\"%s\">
(org-file-image-p
path org-export-html-inline-image-extensions))
(setq rpl (org-export-html-format-image
- (concat type ":" path)))
+ (concat type ":" path) org-par-open))
(setq link (concat type ":" path))
(setq rpl (concat "
(or (eq t org-export-html-inline-images)
(and org-export-html-inline-images
(not descp))))
- (org-export-html-format-image thefile)
+ (progn
+ (message "image %s %s" thefile org-par-open)
+ (org-export-html-format-image thefile org-par-open))
(concat ""
(org-export-html-format-desc desc)
"")))
@@ -4019,7 +4021,7 @@ lang=\"%s\" xml:lang=\"%s\">
(org-html-do-expand s))
s))
-(defun org-export-html-format-image (src)
+(defun org-export-html-format-image (src par-open)
"Create image tag with source and attributes."
(save-match-data
(if (string-match "^ltxpng/" src)
@@ -4027,15 +4029,18 @@ 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 "
+ (format "%s
%s
-
"
+
%s"
+ (if org-par-open "
\n" "")
(if label (format "id=\"%s\" " label) "")
src
(if (string-match "\\" caption "") ""))))))
+ (if caption (concat "\n" caption "
") "")
+ (if org-par-open "\n" ""))))))
+
(defvar org-table-colgroup-info nil)
(defun org-format-table-ascii (lines)