From: Jacek Generowicz <jacek.generowicz@cern.ch>
To: emacs-orgmode@gnu.org
Subject: org-export-blocks, HTML, <p> problem.
Date: Sat, 8 Oct 2011 01:16:51 +0200 [thread overview]
Message-ID: <79F4E647-E161-465A-8E0F-FED9FFC73259@cern.ch> (raw)
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)
next reply other threads:[~2011-10-07 23:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-07 23:16 Jacek Generowicz [this message]
2011-10-07 23:58 ` org-export-blocks, HTML, <p> problem Samuel Wales
2011-10-08 7:25 ` Jacek Generowicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=79F4E647-E161-465A-8E0F-FED9FFC73259@cern.ch \
--to=jacek.generowicz@cern.ch \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.