emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Org-special-blogs does not make well-formed xhtml


From: Christian Moe
Subject: [O] Org-special-blogs does not make well-formed xhtml
Date: Mon, 03 Oct 2011 14:44:40 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110624 Thunderbird/5.0

Hi,

XHTML produced with Org-special-blocks is not well-formed; <div> tags get wrapped in <p> tags. Example:

   Some text.

   #+begin_sidebar
     Some details left out of the main text.

     Some more details.
   #+end_sidebar

   Some more text.

This results in the following html, which causes XML processors to fail.

   <p>
   <div class="sidebar">
     Some details left out of the main text.
   </p>
   <p>
     Some more details.
   </div>
   </p>
   <p>
   Some more text.
   </p></div>

The problem seems to be fixed by un-commenting the fifth line in the below function in org-special-blocks.el:

   (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 "<div class=\"" (match-string 1 line) "\">\n")
         (insert "</div>\n"))
       (throw 'nextline nil)))

Does anyone know if that was commented out for a reason?


Yours,
Christian



reply via email to

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