diff options
Diffstat (limited to 'lisp/org/org-special-blocks.el')
-rw-r--r-- | lisp/org/org-special-blocks.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/org/org-special-blocks.el b/lisp/org/org-special-blocks.el index c09b27de895..86caa4d4f09 100644 --- a/lisp/org/org-special-blocks.el +++ b/lisp/org/org-special-blocks.el @@ -1,6 +1,4 @@ -;;; org-special-blocks.el --- Turn blocks into LaTeX envs and HTML divs - -;; Copyright (C) 2009, 2011 Free Software Foundation, Inc. +;; Copyright (C) 2009-2011 Free Software Foundation, Inc. ;; Author: Chris Gray <chrismgray@gmail.com> @@ -38,8 +36,12 @@ ;; user to add this class to his or her stylesheet if this div is to ;; mean anything. +(require 'org-html) (require 'org-compat) +(declare-function org-open-par "org-html" ()) +(declare-function org-close-par-maybe "org-html" ()) + (defvar org-special-blocks-ignore-regexp "^\\(LaTeX\\|HTML\\)$" "A regexp indicating the names of blocks that should be ignored by org-special-blocks. These blocks will presumably be @@ -82,11 +84,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 |