From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacek Generowicz Subject: org-export-blocks, HTML,

problem. Date: Sat, 8 Oct 2011 01:16:51 +0200 Message-ID: <79F4E647-E161-465A-8E0F-FED9FFC73259@cern.ch> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset="US-ASCII"; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCJyq-0005eM-SX for emacs-orgmode@gnu.org; Fri, 07 Oct 2011 19:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RCJyp-0002yr-Ue for emacs-orgmode@gnu.org; Fri, 07 Oct 2011 19:37:28 -0400 Received: from cernmx30.cern.ch ([137.138.144.177]:50095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RCJyp-0002yf-JO for emacs-orgmode@gnu.org; Fri, 07 Oct 2011 19:37:27 -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: emacs-orgmode@gnu.org I am trying to define a custom block for export to HTML with org-export-blocks, but I'm getting confused by the way

tags are inserted. I've whittled my org-export-blocks-format-blah function down to the form (defun huh/org-export-blocks-format-blah (body &rest headers) ;; One of the two trivial bodies shown below ) Both of my versions of the test function ignore the block body and write a hard-wired placeholder instead. The placeholder is sandwiched between a preamble and a postamble. In one test function the preamble and post amble are written as HTML, in the other as plain text. Odd things happen when I export *two* consecutive blocks with the HTML version. The implementations of the two test functions and their corresponding results are shown below. ================================== | ================================== body of format function | body of format function ================================== | ================================== (concat | (concat "\n#+HTML: . . . . BEFORE . . . .\n" | "\n. . . . BEFORE . . . .\n" "body of block goes here" | "body of block goes here" "\n#+HTML: . . . . AFTER . . . .") | "\n . . . . AFTER . . . .") | | ================================== ================================== | output output | ================================== ================================== |

|

My heading

My heading

| | |

| . . . . BEFORE . . . . | . . . . BEFORE . . . . body of block goes here |

. . . . AFTER . . . . | body of block goes here

| . . . . AFTER . . . .

| . . . . BEFORE . . . . | . . . . BEFORE . . . . body of block goes here | body of block goes here . . . . AFTER . . . . | . . . . AFTER . . . .

|

================================== | ================================== In the plain version, the all of preamble-body-postamble text is enclosed in

...

, once for each exported block. In the HTML version, only one

...

pair appears, enclosing everything except the first preamble. (As my real preamble should contain an opening tag which is closed in the postamble, the presence of an unmatched

between the two causes trouble.) Can you shed any light on what is going on? Thanks. (I am using org-mode version 7.7)