emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] worg/org-contrib list items are missing


From: Ethan Ligon
Subject: [O] [PATCH] worg/org-contrib list items are missing
Date: Wed, 4 May 2011 19:52:56 -0700

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 <address@hidden> wrote:
> Jason Dunsmore <address@hidden> writes:
>
>> "Sullivan, Gregory (US SSA)" <address@hidden> 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 <address@hidden>
>> 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]*\\)"
          "\\(?:address@hidden(?: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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]