From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baoqiu Cui Subject: Re: Patch to fix two bugs in HTML/DocBook exporters Date: Wed, 08 Apr 2009 22:27:58 -0700 Message-ID: References: <6BB5BE3D-4B4D-4D14-BB8C-2F955A93E041@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrmoK-0008PV-7w for emacs-orgmode@gnu.org; Thu, 09 Apr 2009 01:28:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrmoF-0008KH-CH for emacs-orgmode@gnu.org; Thu, 09 Apr 2009 01:28:23 -0400 Received: from [199.232.76.173] (port=41769 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrmoF-0008Jt-39 for emacs-orgmode@gnu.org; Thu, 09 Apr 2009 01:28:19 -0400 Received: from main.gmane.org ([80.91.229.2]:37892 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LrmoE-0005jZ-HM for emacs-orgmode@gnu.org; Thu, 09 Apr 2009 01:28:18 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Lrmo9-00065B-TQ for emacs-orgmode@gnu.org; Thu, 09 Apr 2009 05:28:14 +0000 Received: from nat-dip6.cfw-a-gci.corp.yahoo.com ([209.131.62.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Apr 2009 05:28:13 +0000 Received: from cbaoqiu by nat-dip6.cfw-a-gci.corp.yahoo.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Apr 2009 05:28:13 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Carsten Dominik writes: >> 1. Bug One: two consecutive lists with different list types at the >> same >> level are exported as *one* list. For example, the following two >> lists >> >> 1. Ordered List Item 1 >> 2. Ordered List Item 2 >> >> - Itemized List Item 1 >> - Itemized List Item 2 >> - Itemized List Item 3 > > This is, actually, not a bug but on purpose. > List boundaries are set by indentation, and the > list type is set by the first item. I prefer to keep it that way. > In the same way, the actual numbers in an ordered list are ignored > and the list is renumbered on export. Thanks for the explanation, Carsten! This makes perfect sense to me. No wonder I found the same "problem" in function `org-beginning-of-item-list'. :-) If a lot of people like to mix different list types together in the way I showed above, I would prefer that Org mode has finer support for this. But for now, I think we should keep the existing way. >> 2. Bug Two: a paragraph *immediately* after a block like quote, verse, >> centered block, example, etc. is not wrapped into paragraph tags >> (

...

in HTML or ... in DocBook). While it is >> not >> a big deal for HTML exporter, this bug makes exported DocBook XML >> document invalid. >> >> The following lines can reproduce this bug: >> >> : Code line one >> : Code line two >> This is a paragraph immediately after the above code block without >> an >> empty line before it, and it is NOT wrapped in a paragraph (

in >> HTML or in DocBook) in exported format. >> >> Please let me know if you see any problems in the fix. > > I would like to fix this bug, and if you send me a patch just > for this, I'd be happy to apply it. OK. I am attaching the new patch at the end. Thanks, Baoqiu --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=para-after-block.diff diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index 70a707b..13b46ed 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -607,6 +607,7 @@ publishing directory." ;; End of quote section? (when (and inquote (string-match "^\\*+ " line)) (insert "]]>\n\n") + (org-export-docbook-open-para) (setq inquote nil)) ;; Inside a quote section? (when inquote @@ -625,7 +626,8 @@ publishing directory." (not (string-match "^[ \t]*\\(:.*\\)" (car lines)))) (setq infixed nil) - (insert "]]>\n\n")) + (insert "]]>\n\n") + (org-export-docbook-open-para)) (throw 'nextline nil)) ;; Protected HTML @@ -682,11 +684,13 @@ publishing directory." (when (equal "ORG-BLOCKQUOTE-END" line) (org-export-docbook-close-para-maybe) (insert "\n") + (org-export-docbook-open-para) (throw 'nextline nil)) ;; End of verses (when (equal "ORG-VERSE-END" line) (insert "\n\n") + (org-export-docbook-open-para) (setq inverse nil) (throw 'nextline nil)) @@ -705,6 +709,7 @@ publishing directory." (org-export-docbook-close-para-maybe) (insert "\n" "\n\n") + (org-export-docbook-open-para) (throw 'nextline nil)) ;; Make targets to anchors. Note that currently FOP does not diff --git a/lisp/org-html.el b/lisp/org-html.el index b422066..b41ef3b 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -761,6 +761,7 @@ lang=\"%s\" xml:lang=\"%s\"> ;; end of quote section? (when (and inquote (string-match "^\\*+ " line)) (insert "\n") + (org-open-par) (setq inquote nil)) ;; inside a quote section? (when inquote @@ -780,7 +781,8 @@ lang=\"%s\" xml:lang=\"%s\"> (not (string-match "^[ \t]*:\\(\\([ \t]\\|$\\)\\(.*\\)\\)" (car lines)))) (setq infixed nil) - (insert "\n")) + (insert "\n") + (org-open-par)) (throw 'nextline nil)) ;; Protected HTML @@ -814,6 +816,7 @@ lang=\"%s\" xml:lang=\"%s\"> (when (equal "ORG-BLOCKQUOTE-END" line) (org-close-par-maybe) (insert "\n\n") + (org-open-par) (throw 'nextline nil)) (when (equal "ORG-VERSE-START" line) (org-close-par-maybe) @@ -822,6 +825,7 @@ lang=\"%s\" xml:lang=\"%s\"> (throw 'nextline nil)) (when (equal "ORG-VERSE-END" line) (insert "

\n") + (org-open-par) (setq inverse nil) (throw 'nextline nil)) (when (equal "ORG-CENTER-START" line) @@ -832,6 +836,7 @@ lang=\"%s\" xml:lang=\"%s\"> (when (equal "ORG-CENTER-END" line) (org-close-par-maybe) (insert "\n") + (org-open-par) (throw 'nextline nil)) (when inverse (let ((i (org-get-string-indentation line))) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--