From: Christian Moe <email@example.com>
To: Org Mode <firstname.lastname@example.org>
Cc: Carsten Dominik <email@example.com>
Subject: [PATCH] Special blocks: Make well-formed HTML
Date: Thu, 06 Oct 2011 11:53:32 +0200 [thread overview]
Message-ID: <4E8D7A9C.firstname.lastname@example.org> (raw)
(org-special-blocks-convert-html-special-cookies): Close paragraph
before opening or closing the <div>, 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
<div> tags in <p> tags.
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
@@ -78,15 +78,19 @@ seen. This is run after a few special cases are
taken care of."
(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)
- (message "%s" (match-string 1))
- (if (equal (match-string 2 line) "START")
- (insert "<div class=\"" (match-string 1 line) "\">\n")
- (insert "</div>\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")
+ (insert "\n<div class=\"" (match-string 1 line) "\">")
+ (when (equal (match-string 2 line) "END")
+ (insert "\n</div>")
+ (throw 'nextline nil)))
reply other threads:[~2011-10-06 9:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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:
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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 public inbox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).