[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Patch to fix two bugs in HTML/DocBook exporters
From: |
Baoqiu Cui |
Subject: |
[Orgmode] Patch to fix two bugs in HTML/DocBook exporters |
Date: |
Mon, 06 Apr 2009 14:37:39 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (darwin) |
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).
: <ol>
: <li>
: Ordered List Item 1
: </li>
: <li>
: Ordered List Item 2
:
: </li>
: <li>
: Itemized List Item 1
: </li>
: <li>
: Itemized List Item 2
: </li>
: <li>
: Itemized List Item 3
:
: </li>
: </ol>
2. Bug Two: a paragraph *immediately* after a block like quote, verse,
centered block, example, etc. is not wrapped into paragraph tags
(<p>...</p> in HTML or <para>...</para> 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 (<p> in
HTML or <para> in DocBook) in exported format.
Please let me know if you see any problems in the fix.
Thanks,
Baoqiu
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</programlisting>\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</programlisting>\n"))
+ (insert "]]>\n</programlisting>\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 "</blockquote>\n")
+ (org-export-docbook-open-para)
(throw 'nextline nil))
;; End of verses
(when (equal "ORG-VERSE-END" line)
(insert "</literallayout>\n</blockquote>\n")
(setq inverse nil)
+ (org-export-docbook-open-para)
(throw 'nextline nil))
;; Text centering. Element <para role="centered"> does not
@@ -704,6 +708,7 @@ publishing directory."
(org-export-docbook-close-para-maybe)
(insert "</entry></row></tbody>\n"
"</tgroup>\n</informaltable>\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 "</pre>\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 "</pre>\n"))
+ (insert "</pre>\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</blockquote>\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 "</p>\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</div>")
+ (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))
- [Orgmode] Patch to fix two bugs in HTML/DocBook exporters,
Baoqiu Cui <=
- Re: [Orgmode] Patch to fix two bugs in HTML/DocBook exporters, Carsten Dominik, 2009/04/08
- [Orgmode] Re: Patch to fix two bugs in HTML/DocBook exporters, Baoqiu Cui, 2009/04/09
- [Orgmode] Re: Patch to fix two bugs in HTML/DocBook exporters, Leo, 2009/04/09
- [Orgmode] Re: Patch to fix two bugs in HTML/DocBook exporters, Baoqiu Cui, 2009/04/09
- Re: [Orgmode] Re: Patch to fix two bugs in HTML/DocBook exporters, Carsten Dominik, 2009/04/09
- [Orgmode] Re: Patch to fix two bugs in HTML/DocBook exporters, Baoqiu Cui, 2009/04/09
- Re: [Orgmode] Re: Patch to fix two bugs in HTML/DocBook exporters, Carsten Dominik, 2009/04/11
- Re: [Orgmode] Re: Patch to fix two bugs in HTML/DocBook exporters, Mike Newman, 2009/04/09
- Re: [Orgmode] Re: Patch to fix two bugs in HTML/DocBook exporters, Carsten Dominik, 2009/04/11