emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Baoqiu Cui <cbaoqiu@yahoo.com>
To: emacs-orgmode@gnu.org
Subject: Re: Patch to fix two bugs in HTML/DocBook exporters
Date: Wed, 08 Apr 2009 22:27:58 -0700	[thread overview]
Message-ID: <bycvdpe75wh.fsf@muchbodyking-lm.corp.yahoo.com> (raw)
In-Reply-To: <6BB5BE3D-4B4D-4D14-BB8C-2F955A93E041@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1835 bytes --]

Carsten Dominik <carsten.dominik@gmail.com> 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
>>   (<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.
>
> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: para-after-block.diff --]
[-- Type: text/x-patch, Size: 2950 bytes --]

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</programlisting>\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</programlisting>\n"))
+	      (insert "]]>\n</programlisting>\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 "</blockquote>\n")
+	    (org-export-docbook-open-para)
 	    (throw 'nextline nil))
 
 	  ;; End of verses
 	  (when (equal "ORG-VERSE-END" line)
 	    (insert "</literallayout>\n</blockquote>\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 "</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
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 "</pre>\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 "</pre>\n"))
+	      (insert "</pre>\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</blockquote>\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 "</p>\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</div>")
+	    (org-open-par)
 	    (throw 'nextline nil))
 	  (when inverse
 	    (let ((i (org-get-string-indentation line)))

[-- Attachment #3: Type: text/plain, Size: 204 bytes --]

_______________________________________________
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

  reply	other threads:[~2009-04-09  5:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06 21:37 Baoqiu Cui
2009-04-08 15:16 ` Carsten Dominik
2009-04-09  5:27   ` Baoqiu Cui [this message]
2009-04-09  7:25     ` Leo
2009-04-09  8:06       ` Baoqiu Cui
2009-04-09 10:33     ` Carsten Dominik
2009-04-09 18:29       ` Baoqiu Cui
2009-04-11  6:19         ` Carsten Dominik
2009-04-09 21:03       ` Mike Newman
2009-04-11  6:20         ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bycvdpe75wh.fsf@muchbodyking-lm.corp.yahoo.com \
    --to=cbaoqiu@yahoo.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Patch to fix two bugs in HTML/DocBook exporters' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this 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).