emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ethan Ligon <ligon@are.berkeley.edu>
To: Ethan Ligon <ligon@are.berkeley.edu>, emacs-orgmode@gnu.org
Subject: Re: [PATCH] Problem with html export of description list items
Date: Fri, 8 Apr 2011 20:19:44 -0700	[thread overview]
Message-ID: <BANLkTi=QuzD=yBNaJMbNm9gKk1cy6DdHvQ@mail.gmail.com> (raw)
In-Reply-To: <8739lt5588.fsf@gmail.com>

Nic-

Sent this to the list earlier; should have cc'd you.

Thanks again for your help!
-Ethan
------------------------------------------------------------------------------
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) "???"))


-- 
Ethan Ligon, Associate Professor
Agricultural & Resource Economics
University of California, Berkeley

      parent reply	other threads:[~2011-04-09  3:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-06  0:07 [Bug] Problem with html export of description list items Ethan Ligon
2011-04-06  0:38 ` [PATCH] " Ethan Ligon
2011-04-07 12:51   ` Nicolas Goaziou
2011-04-07 21:52     ` Ethan Ligon
2011-04-08 11:53       ` Nicolas Goaziou
2011-04-08 17:46         ` [PATCH] Fix for html & docbook " Ethan Ligon
2011-04-09  3:19         ` Ethan Ligon [this message]

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='BANLkTi=QuzD=yBNaJMbNm9gKk1cy6DdHvQ@mail.gmail.com' \
    --to=ligon@are.berkeley.edu \
    --cc=emacs-orgmode@gnu.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).