From: Ethan Ligon <ligon@are.berkeley.edu>
To: Matt Lundin <mdl@imapmail.org>
Cc: Jason Dunsmore <emacs-orgmode@dunsmor.com>,
"Emacs-orgmode@gnu.org" <Emacs-orgmode@gnu.org>
Subject: [PATCH] worg/org-contrib list items are missing
Date: Wed, 4 May 2011 19:52:56 -0700 [thread overview]
Message-ID: <BANLkTikJKH3ssM7kpdcgrvY95fRzSBfKQA@mail.gmail.com> (raw)
In-Reply-To: <87oc3it3m0.fsf@fastmail.fm>
Okay. I deny that 49e6bc899758114d6d29e69a8f9e40798d26782b broke html
export. Before that patch there were *two* bugs related to
description lists. After that there was one. See below for an
explanation and patch. This also fixes an analogous bug in latex
export.
On Wed, May 4, 2011 at 5:04 PM, Matt Lundin <mdl@imapmail.org> wrote:
> Jason Dunsmore <emacs-orgmode@dunsmor.com> writes:
>
>> "Sullivan, Gregory (US SSA)" <gregory.sullivan@baesystems.com> writes:
>>
>>> Something is broken exporting worg source to lists:
>>>
>>> http://orgmode.org/worg/org-contrib/
>>>
>>> is missing the list item headers.
>>
>> I see it's missing the left part of the description list items. I ran a
>> git-bisect and found the commit that introduced the problem:
>
> FWIW, the worg page can be fixed by adding an extra space after the "::"
> in the first description item. I'm applying this fix to Worg for the
> sake of readability, but am documenting my actions here, since it is
> related to the patch below.
>
> Best,
> Matt
>
>>
>> 49e6bc899758114d6d29e69a8f9e40798d26782b is the first bad commit
>> commit 49e6bc899758114d6d29e69a8f9e40798d26782b
>> Author: Ethan Ligon <ligon@are.berkeley.edu>
>> Date: Sat Apr 9 18:39:35 2011 +0200
>>
>> Fix for html & docbook export of description list items
>>
>> The problem is illustrated by the following example:
>>
>> * Illustration of bug in html export
>> - This has a space after the colons :: so will work in latex and html
>> - This doesn't have a space after the colons ::so is an invalid
>> description item according to the org manual. Won't work in html
>> or docbook. Will nevertheless work in latex, provided /first/
>> description item is valid.
>> - Has a terminating space ::
>> - So it works in both html and latex export!
>> - Even though it's difficult to distinguish from the next example.
>> - Lacks a terminating space ::
>> - At present, *doesn't* work in html or docbook export, does in
>> latex. This is the case that the following patch fixes.
>>
>> :040000 040000 feb2527d8b3294e9d9a118f4752a414b8431d706 4bdeed49ce735a321ddbb3053c22282dd9909677 M lisp
>>
>> Ethan, can you investigate?
>
The first bug was that when org-html.el or org-docbook.el tried to
process a description list, if the first item in a list looked like
- /org-annotate-file.el/ -- annotate a file with org syntax ::
without a trailing space or tab, then the entire list would be treated
as a bullet list, not a description list.
The second bug was that if the list was identified by org-list.el as
being a description list, but a *subsequent* item looked like the
example above, then the description would get swallowed, and replaced
by a ??? in html export.
The commit mentioned above fixed the second problem. But that
uncovered the first bug, trigged by a description list in
Worg/org-contrib/index.org.
* Illustration of bug in org-list identification of description lists
- This doesn't have a space after the colons ::
Previously, export would break, and description wouldn't be printed.
- Even worse :: All other subsequent description items in the same
list would also not work---they'd be exported as bullet lists,
with the description stripped out (in html export).
- Prior to commit 49e6bc899758114d6d29e69a8f9e40798d26782b :: this
list would have been interpreted as a list of bullets, with
the list item content including the description.
- After commit 49e6bc899758114d6d29e69a8f9e40798d26782b :: this
list would still have been interpreted as a list of bullets,
but code in org-html.el (or org-docbook.el) would have
stripped out the description part.
- After fixing the regex in org-list.el :: Every description item in
this list is exported correctly in both html and latex export.
Here's a patch that fixes the regex in org-list.el:
diff --git a/lisp/org-list.el b/lisp/org-list.el
index 9c178e1..83d6828 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -369,7 +369,7 @@ It depends on `org-empty-line-terminates-plain-lists'.")
(concat "^[ \t]*\\(\\(?:[-+*]\\|\\(?:[0-9]+\\|[A-Za-z]\\)[.)]\\)[ \t]*\\)"
"\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\]\\)?"
"\\(?:\\(\\[[ X-]\\]\\)[ \t]+\\)?"
- "\\(?:\\(.*\\)[ \t]+::[ \t]+\\)?")
+ "\\(?:\\(.*\\)[ \t]+::\\(?:[ \t]+\\|$\\)\\)?")
"Matches a list item and puts everything into groups:
group 1: bullet
group 2: counter
--
Ethan Ligon, Associate Professor
Agricultural & Resource Economics
University of California, Berkeley
next prev parent reply other threads:[~2011-05-05 2:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 20:51 worg/org-contrib list items are missing Sullivan, Gregory (US SSA)
2011-05-04 21:44 ` Jason Dunsmore
2011-05-05 0:04 ` Matt Lundin
2011-05-05 2:52 ` Ethan Ligon [this message]
2011-05-07 0:35 ` [PATCH] " Nicolas Goaziou
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=BANLkTikJKH3ssM7kpdcgrvY95fRzSBfKQA@mail.gmail.com \
--to=ligon@are.berkeley.edu \
--cc=Emacs-orgmode@gnu.org \
--cc=emacs-orgmode@dunsmor.com \
--cc=mdl@imapmail.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public 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).