diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-03-11 12:27:42 +0100 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-03-11 12:27:42 +0100 |
commit | c6cfd3cfd3f054b42b91d6b64464ab449530ec4e (patch) | |
tree | ec818e18401b8adbac4d351d31a16a764e430ace | |
parent | 77eda20bb62e8be8ec2d03b44baa3b488e23f5b3 (diff) | |
download | org-mode-c6cfd3cfd3f054b42b91d6b64464ab449530ec4e.tar.gz |
HTML export: Fix problem with table attributes when first table line is special
Eric Fraga writes:
> What am I missing? I tried exporting the following to HTML and the
> caption and HTML attributes seem to be ignored completely. Also, the
> alignment directives are ignored as well.
>
> --8<---------------cut here---------------start------------->8---
> #+TITLE: test file for org mode
> #+DESCRIPTION: used for bug reports
> #+AUTHOR: Eric S Fraga
> #+EMAIL: Eric S Fraga <e.fraga@ucl.ac.uk>
> #+DATE: 2010-03-11 Thu
> #+KEYWORDS:
> #+LANGUAGE: en
> #+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
> #+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
> #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
> #+EXPORT_SELECT_TAGS: export
> #+EXPORT_EXCLUDE_TAGS: noexport
> #+LINK_UP:
> #+LINK_HOME:
>
> * tables
>
> #+caption: A very interesting table
> #+attr_html: border="1" rules="all" frame="all" align="center"
> | <r> | <l> |
> | Id | Description |
> |-----+--------------------------------|
> | 1. | The first item |
> | 2. | the second |
> | 4. | we don't have a third one |
> | 10. | a longer id to check alignment |
> |-----+--------------------------------|
> --8<---------------cut here---------------end--------------->8---
>
> I'm using org current as of yesterday Org-mode version 6.34trans
> (release_6.34c.186.g1902) and with GNU Emacs 23.1.1
> (i486-pc-linux-gnu, GTK+ Version 2.18.2) of 2009-11-02 on raven,
> modified by Debian
-rwxr-xr-x | lisp/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/org-exp.el | 11 |
2 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9cb165f..6d30f08 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2010-03-11 Carsten Dominik <carsten.dominik@gmail.com> + * org-exp.el (org-export-attach-captions-and-attributes): Add the + properties to the entire table, in case the first line is + removed. + * org-archive.el (org-archive-reversed-order): New option. (org-archive-subtree, org-archive-to-archive-sibling): Use the new option `org-archive-reversed-order'. diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 91feb3c..23b5504 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1888,10 +1888,10 @@ table line. If it is a link, add it to the line containing the link." "\\|" "^[ \t]*#\\+label:[ \t]+\\(.*\\)" "\\|" - "^[ \t]*|[^-]" + "^[ \t]*\\(|[^-]\\)" "\\|" "^[ \t]*\\[\\[.*\\]\\][ \t]*$")) - cap attr label) + cap attr label end) (while (re-search-forward re nil t) (cond ((match-end 1) @@ -1901,11 +1901,16 @@ table line. If it is a link, add it to the line containing the link." ((match-end 3) (setq label (org-trim (match-string 3)))) (t - (add-text-properties (point-at-bol) (point-at-eol) + (setq end (if (match-end 4) + (let ((ee (org-table-end))) + (prog1 (1- (marker-position ee)) (move-marker ee nil))) + (point-at-eol))) + (add-text-properties (point-at-bol) end (list 'org-caption cap 'org-attributes attr 'org-label label)) (if label (push (cons label label) target-alist)) + (goto-char end) (setq cap nil attr nil label nil))))) target-alist) |