From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baoqiu Cui Subject: Patch to fix two bugs in HTML/DocBook exporters Date: Mon, 06 Apr 2009 14:37:39 -0700 Message-ID: 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 1LqwW1-0004g3-Pn for emacs-orgmode@gnu.org; Mon, 06 Apr 2009 17:38:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LqwVx-0004bs-3d for emacs-orgmode@gnu.org; Mon, 06 Apr 2009 17:38:01 -0400 Received: from [199.232.76.173] (port=44000 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LqwVw-0004bl-PR for emacs-orgmode@gnu.org; Mon, 06 Apr 2009 17:37:56 -0400 Received: from main.gmane.org ([80.91.229.2]:41071 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 1LqwVv-0004ln-W5 for emacs-orgmode@gnu.org; Mon, 06 Apr 2009 17:37:56 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LqwVt-0004Cc-It for emacs-orgmode@gnu.org; Mon, 06 Apr 2009 21:37:54 +0000 Received: from nat-dip4.cfw-a-gci.corp.yahoo.com ([209.131.62.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Apr 2009 21:37:53 +0000 Received: from cbaoqiu by nat-dip4.cfw-a-gci.corp.yahoo.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Apr 2009 21:37:53 +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 --=-=-= Hi Carsten, During the weekend, I found and fixed two bugs that exist in HTML/DocBook exporters (see the following descriptions). I am attaching a patch for the fixes at the end of this email. 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 are exported as one ordered list in HTML (see below, similar problem also exist in DocBook). :
    :
  1. : Ordered List Item 1 :
  2. :
  3. : Ordered List Item 2 : :
  4. :
  5. : Itemized List Item 1 :
  6. :
  7. : Itemized List Item 2 :
  8. :
  9. : Itemized List Item 3 : :
  10. :
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. Thanks, Baoqiu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=consecutive-lists.diff diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index 3739181..0b87ada 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -606,6 +606,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 @@ -624,7 +625,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 @@ -681,12 +683,14 @@ 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") (setq inverse nil) + (org-export-docbook-open-para) (throw 'nextline nil)) ;; Text centering. Element does not @@ -704,6 +708,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 @@ -969,7 +974,9 @@ publishing directory." (setq didclose nil) (while (and in-local-list (or (and (= ind (car local-list-indent)) - (not starter)) + (or (not starter) + (not (equal item-type + (car local-list-type))))) (< ind (car local-list-indent)))) (setq didclose t) (let ((listtype (car local-list-type))) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index df5c6a5..a8a3dfc 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -3687,6 +3687,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 @@ -3706,7 +3707,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 @@ -3740,6 +3742,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) @@ -3749,6 +3752,7 @@ lang=\"%s\" xml:lang=\"%s\"> (when (equal "ORG-VERSE-END" line) (insert "

\n") (setq inverse nil) + (org-open-par) (throw 'nextline nil)) (when (equal "ORG-CENTER-START" line) (org-close-par-maybe) @@ -3758,6 +3762,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))) @@ -4066,7 +4071,9 @@ lang=\"%s\" xml:lang=\"%s\"> (setq didclose nil) (while (and in-local-list (or (and (= ind (car local-list-indent)) - (not starter)) + (or (not starter) + (not (equal item-type + (car local-list-type))))) (< ind (car local-list-indent)))) (setq didclose t) (org-close-li (car local-list-type)) --=-=-= 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 --=-=-=--