From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ethan Ligon Subject: Re: [PATCH] Fix for html & docbook export of description list items Date: Fri, 8 Apr 2011 17:46:35 +0000 (UTC) Message-ID: References: <87bp0i5io5.fsf@gmail.com> <8739lt5588.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=36698 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8Fll-0006SZ-FO for emacs-orgmode@gnu.org; Fri, 08 Apr 2011 13:46:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q8Fli-0000ED-Jp for emacs-orgmode@gnu.org; Fri, 08 Apr 2011 13:46:53 -0400 Received: from lo.gmane.org ([80.91.229.12]:51128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q8Fli-0000DS-0g for emacs-orgmode@gnu.org; Fri, 08 Apr 2011 13:46:50 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q8Fle-0007sR-Rb for emacs-orgmode@gnu.org; Fri, 08 Apr 2011 19:46:46 +0200 Received: from gia331.ARE.Berkeley.EDU ([128.32.251.34]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Apr 2011 19:46:46 +0200 Received: from ligon by gia331.ARE.Berkeley.EDU with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Apr 2011 19:46:46 +0200 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 After some very helpful corrections and suggestions from Nic, I'd like to propose the following patch, which addresses a problem in the html and docbook export of description items. The problem is illustrated by the following example: #+begin_src org * 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. #+end_src diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index dbb608d..124e1dc 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -1382,7 +1382,7 @@ the alist of previous items." (string-match (concat "[ \t]*\\(\\S-+[ \t]*\\)" "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[a-zA-Z]\\)\\]\\)?" "\\(?:\\(\\[[ X-]\\]\\)[ \t]+\\)?" - "\\(?:\\(.*\\)[ \t]+::[ \t]+\\)?" + "\\(?:\\(.*\\)[ \t]+::\\(?:[ \t]+\\|$\\)\\)?" "\\(.*\\)") line) (let* ((checkbox (match-string 3 line)) diff --git a/lisp/org-html.el b/lisp/org-html.el index d19d88b..4ae6d99 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -2501,7 +2501,7 @@ the alist of previous items." (concat "[ \t]*\\(\\S-+[ \t]*\\)" "\\(?:\\[@\\(?:start:\\)?\\([0-9]+\\|[A-Za-z]\\)\\]\\)?" "\\(?:\\(\\[[ X-]\\]\\)[ \t]+\\)?" - "\\(?:\\(.*\\)[ \t]+::[ \t]+\\)?" + "\\(?:\\(.*\\)[ \t]+::\\(?:[ \t]+\\|$\\)\\)?" "\\(.*\\)") line) (let* ((checkbox (match-string 3 line)) (desc-tag (or (match-string 4 line) "???"))