From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Org-special-blogs does not make well-formed xhtml Date: Tue, 04 Oct 2011 20:06:36 +0530 Message-ID: <81ipo4u8ln.fsf@gmail.com> References: <4E89AE38.3020309@christianmoe.com> <80r52unr44.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB67M-0007WJ-Oo for emacs-orgmode@gnu.org; Tue, 04 Oct 2011 10:37:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RB67G-0000jG-MZ for emacs-orgmode@gnu.org; Tue, 04 Oct 2011 10:37:12 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:54223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB67G-0000j9-Hm for emacs-orgmode@gnu.org; Tue, 04 Oct 2011 10:37:06 -0400 Received: by pzk4 with SMTP id 4so1652254pzk.6 for ; Tue, 04 Oct 2011 07:37:05 -0700 (PDT) In-Reply-To: (Carsten Dominik's message of "Tue, 4 Oct 2011 13:23:35 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Sebastien Vauban , emacs-orgmode@gnu.org Carsten Dominik writes: > On Oct 3, 2011, at 3:26 PM, Sebastien Vauban wrote: > >> Hi Christian Moe, >> >> Christian Moe wrote: >>> Hi, >>> >>> XHTML produced with Org-special-blocks is not well-formed;
tags >>> get wrapped in

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

>>>

>>>

>>>

>>> Some more text. >>>

>>> >>> 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 "
\n") >>> (insert "
\n")) >>> (throw 'nextline nil))) >>> >>> Does anyone know if that was commented out for a reason? >> >> git blame suggests it was there since that file org-special-blocks.el has been >> added (in contrib/lisp, by Carsten, on 2009-05-07 13:53)... >> >> Best regards, >> Seb >> >> -- >> Sebastien Vauban >> >> > > I see no reason to not uncomment this line. Shall we just do this? Shouldn't a paragraph be opened/closed while entering/leaving the div. ,---- See org-xhtml-format-environment | (center | (case beg-end | (BEGIN | (org-lparse-end-paragraph) | (insert "\n
") | (org-lparse-begin-paragraph)) | (END | (org-lparse-end-paragraph) | (insert "\n
") | (org-lparse-begin-paragraph)))) `---- We can always open a paragraph gratis, because empty paragraphs are pruned at the end of export. ps: I haven't gotten myself to understand when paragraphs are opened and closed in the html exporter. So we can take a leaf out of the centering environment and mimic the same behaviour with the special blocks as well. > - Carsten > > > > > --