emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] org-export-blocks, HTML, <p> problem.


From: Jacek Generowicz
Subject: [O] org-export-blocks, HTML, <p> problem.
Date: Sat, 8 Oct 2011 01:16:51 +0200

I am trying to define a custom block for export to HTML with
org-export-blocks, but I'm getting confused by the way <p> 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 | ==================================
 ==================================   |   <div id="content">
<div id="content"> | <h1 class="title">My heading</h1>
 <h1 class="title">My heading</h1>    |
                                      |
                                      |
 <p>                                  |
 . . . . BEFORE . . . .               |  . . . . BEFORE . . . .
 body of block goes here              |      <p>
  . . . . AFTER . . . .               |  body of block goes here
 </p>                                 |  . . . . AFTER . . . .
 <p>                                  |
 . . . . BEFORE . . . .               |  . . . . BEFORE . . . .
 body of block goes here              |      body of block goes here
  . . . . AFTER . . . .               |  . . . . AFTER . . . .
 </p></div>                           |  </p></div>
================================== | ==================================

In the plain version, the all of preamble-body-postamble text is
enclosed in <p> ... </p>, once for each exported block.

In the HTML version, only one <p> ... </p> 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 <p> between the two causes trouble.)

Can you shed any light on what is going on?

Thanks.

(I am using org-mode version 7.7)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]