0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-27 11:02:57 +00:00

Export: Fix XHTML validity problem with figure divs

This commit is contained in:
Carsten Dominik 2009-02-02 12:08:23 +01:00
parent 852a86f446
commit a9618e4e45
2 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2009-02-02 Carsten Dominik <carsten.dominik@gmail.com>
* 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 <carsten.dominik@gmail.com>
* org.el (org-yank-adjusted-subtrees, org-return-follows-link)

View file

@ -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 "<a href=\""
(org-export-html-format-href link)
@ -3692,7 +3692,9 @@ lang=\"%s\" xml:lang=\"%s\">
(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 "<a href=\"" thefile "\"" attr ">"
(org-export-html-format-desc desc)
"</a>")))
@ -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 "<div %sclass=\"figure\">
(format "%s<div %sclass=\"figure\">
<p><img src=\"%s\"%s /></p>%s
</div>"
</div>%s"
(if org-par-open "</p>\n" "")
(if label (format "id=\"%s\" " label) "")
src
(if (string-match "\\<alt=" (or attr ""))
(concat " " attr )
(concat " " attr " alt=\"" src "\""))
(if caption (concat "\n<p>" caption "</p>") ""))))))
(if caption (concat "\n<p>" caption "</p>") "")
(if org-par-open "\n<p>" ""))))))
(defvar org-table-colgroup-info nil)
(defun org-format-table-ascii (lines)