aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ox-jira.el10
-rw-r--r--ox-jira.org15
-rw-r--r--test/ox-jira-test.el2
-rw-r--r--test/ox-jira-test.org2
4 files changed, 22 insertions, 7 deletions
diff --git a/ox-jira.el b/ox-jira.el
index 2bc0a01..8afc6db 100644
--- a/ox-jira.el
+++ b/ox-jira.el
@@ -249,8 +249,14 @@ contextual information."
"Transcode a TABLE-CELL element from Org to JIRA.
CONTENTS holds the contents of the table-cell. INFO is a plist holding
contextual information."
- (concat (format "| %s " contents)
- (if (org-export-last-sibling-p table-cell info) "|" "")))
+ (let* ((row (org-element-property :parent table-cell))
+ (table (org-element-property :parent row))
+ (has-header (org-export-table-has-header-p table info))
+ (group (org-export-table-row-group row info))
+ (is-header (and has-header (eq 1 group)))
+ (sep (if is-header "||" "|")))
+ (format "%s %s %s" sep contents
+ (if (org-export-last-sibling-p table-cell info) sep ""))))
(defun org-jira-statistics-cookie (statistics-cookie _contents _info)
"Transcode a STATISTICS-COOKIE object from Org to JIRA.
diff --git a/ox-jira.org b/ox-jira.org
index 821eff6..ab3c156 100644
--- a/ox-jira.org
+++ b/ox-jira.org
@@ -481,15 +481,24 @@
(format "%s\n" contents)))
#+END_SRC
- And table cells:
+ The cell itself does not know if it is a header cell or not, so we have to
+ ask its containing row if it is the first row, and the table if it has a
+ header row at all. If those things are true, make the cell a header cell.
#+BEGIN_SRC emacs-lisp
(defun org-jira-table-cell (table-cell contents info)
"Transcode a TABLE-CELL element from Org to JIRA.
CONTENTS holds the contents of the table-cell. INFO is a plist holding
contextual information."
- (concat (format "| %s " contents)
- (if (org-export-last-sibling-p table-cell info) "|" "")))
+ ;; (pp table-cell)
+ (let* ((row (org-element-property :parent table-cell))
+ (table (org-element-property :parent row))
+ (has-header (org-export-table-has-header-p table info))
+ (group (org-export-table-row-group row info))
+ (is-header (and has-header (eq 1 group)))
+ (sep (if is-header "||" "|")))
+ (format "%s %s %s" sep contents
+ (if (org-export-last-sibling-p table-cell info) sep ""))))
#+END_SRC
diff --git a/test/ox-jira-test.el b/test/ox-jira-test.el
index a96c103..5aab8da 100644
--- a/test/ox-jira-test.el
+++ b/test/ox-jira-test.el
@@ -171,7 +171,7 @@ END;
;;
;; but I haven't figured out how to identify the header row yet. This test
;; checks that we at least ignore the horizontal lines.
- (should (equal "| a | b |
+ (should (equal "|| a || b ||
| c | d |
" (org-export-string-as "
| a | b |
diff --git a/test/ox-jira-test.org b/test/ox-jira-test.org
index 7e4f4bf..75272d7 100644
--- a/test/ox-jira-test.org
+++ b/test/ox-jira-test.org
@@ -289,7 +289,7 @@
;;
;; but I haven't figured out how to identify the header row yet. This test
;; checks that we at least ignore the horizontal lines.
- (should (equal "| a | b |
+ (should (equal "|| a || b ||
| c | d |
" (org-export-string-as "
| a | b |