From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: [PATCH] Special blocks: Make well-formed HTML Date: Thu, 06 Oct 2011 11:53:32 +0200 Message-ID: <4E8D7A9C.5040903@christianmoe.com> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBkbY-0000HG-0U for emacs-orgmode@gnu.org; Thu, 06 Oct 2011 05:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBkbW-00059Z-QI for emacs-orgmode@gnu.org; Thu, 06 Oct 2011 05:51:03 -0400 Received: from mars.hitrost.net ([91.185.211.18]:55796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBkbW-00059U-Kv for emacs-orgmode@gnu.org; Thu, 06 Oct 2011 05:51:02 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode Cc: Carsten Dominik * org-special-blocks.el (org-special-blocks-convert-html-special-cookies): Close paragraph before opening or closing the
, 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
tags in

tags. TINYCHANGE This patch only borrows a few lines from the handling of `CENTER' blocks in org-export-as-html. --- lisp/org-special-blocks.el | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lisp/org-special-blocks.el b/lisp/org-special-blocks.el index 2da57f0..f4e6258 100644 --- a/lisp/org-special-blocks.el +++ b/lisp/org-special-blocks.el @@ -78,15 +78,19 @@ seen. This is run after a few special cases are taken care of." (defvar line) (defun org-special-blocks-convert-html-special-cookies () - "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 "

\n") - (insert "
\n")) - (throw 'nextline nil))) +"Converts the special cookies into div blocks." +;; Uses the dynamically-bound variable `line'. +(when (string-match "^ORG-\\(.*\\)-\\(START\\|END\\)$" line) + (message "%s" (match-string 1)) + (when (equal (match-string 2 line) "START") + (org-close-par-maybe) + (insert "\n
") + (org-open-par)) + (when (equal (match-string 2 line) "END") + (org-close-par-maybe) + (insert "\n
") + (org-open-par)) + (throw 'nextline nil))) (add-hook 'org-export-html-after-blockquotes-hook 'org-special-blocks-convert-html-special-cookies) -- 1.7.4.1