Special blocks: Make well-formed HTML

* org-special-blocks.el
(org-special-blocks-convert-html-special-cookies): Close paragraph
before opening or closing the <div>, and open paragraph after. Also
changed newline placement to be the same as for other blocks.

The problem was that special blocks did not produce well-formed HTML
because they  wrapped the opening and closing
<div> tags in <p> tags.

TINYCHANGE

This patch only borrows a few lines from the handling of `CENTER'
blocks in org-export-as-html.
This commit is contained in:
Christian Moe 2011-12-11 14:11:05 +01:00 committed by Bastien Guerry
parent 7a513b2c00
commit 78ad6961ae
1 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,3 @@
;; Copyright (C) 2009-2011 Free Software Foundation, Inc.
;; Author: Chris Gray <chrismgray@gmail.com>
@ -81,11 +80,15 @@ seen. This is run after a few special cases are taken care of."
"Converts the special cookies into div blocks."
;; Uses the dynamically-bound variable `line'.
(when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" line)
; (org-close-par-maybe)
(message "%s" (match-string 1))
(if (equal (match-string 2 line) "START")
(insert "<div class=\"" (match-string 1 line) "\">\n")
(insert "</div>\n"))
(when (equal (match-string 2 line) "START")
(org-close-par-maybe)
(insert "\n<div class=\"" (match-string 1 line) "\">")
(org-open-par))
(when (equal (match-string 2 line) "END")
(org-close-par-maybe)
(insert "\n</div>")
(org-open-par))
(throw 'nextline nil)))
(add-hook 'org-export-html-after-blockquotes-hook