emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org-special-blogs does not make well-formed xhtml
@ 2011-10-03 12:44 Christian Moe
  2011-10-03 13:26 ` Sebastien Vauban
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Moe @ 2011-10-03 12:44 UTC (permalink / raw)
  To: Org Mode

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-06 10:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-03 12:44 Org-special-blogs does not make well-formed xhtml Christian Moe
2011-10-03 13:26 ` Sebastien Vauban
2011-10-04 11:23   ` Carsten Dominik
2011-10-04 12:45     ` Christian Moe
2011-10-04 14:22       ` Carsten Dominik
2011-10-04 14:36     ` Jambunathan K
2011-10-04 19:01       ` Christian Moe
2011-10-04 21:33         ` Carsten Dominik
2011-10-06 10:17           ` Christian Moe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).