emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ox-confluence.el: Blank org table cells[...]
@ 2017-04-17  4:00 Stephen Mackenzie
  2017-04-17  9:30 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Mackenzie @ 2017-04-17  4:00 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1767 bytes --]

First post..
Disclaimer, I have no idea what I'm doing. (Don't know lisp, don't know how
to use git format-patch correctly(?), etc.
Fixed this for myself and wanted to try my hand at submitting it.
If I did a terrible job, let me know and I'll try to remedy.
Changelog message explains adequately I hope.

---

From ead5f09134e64794737b9de6913540f9b8fd52da Mon Sep 17 00:00:00 2001
From: Stephen Mackenzie <maxnbk@gmail.com>
Date: Sun, 16 Apr 2017 23:37:40 -0400
Subject: [PATCH] ox-confluence.el: Blank org table cells produce required
whitespace

* contrib/lisp/ox-confluence.el (org-confluence-table-cell):
Adds blank space in empty org table cell such that confluence
tables do not skip empty entries and produce erroneous table headers.

Confluence tables are formatted incorrectly when empty cells
cause `||' to generate the next cell as a table header, skipping
the empty cell. Empty cells must be formatted as `| |'.

TINYCHANGE
---
 contrib/lisp/ox-confluence.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/ox-confluence.el b/contrib/lisp/ox-confluence.el
index a9fac5e..ff8c283 100644
--- a/contrib/lisp/ox-confluence.el
+++ b/contrib/lisp/ox-confluence.el
@@ -171,8 +171,10 @@ a communication channel."
 (defun org-confluence-table-cell  (table-cell contents info)
   (let ((table-row (org-export-get-parent table-cell)))
     (concat
-     (and (org-export-table-row-starts-header-p table-row info) "|")
-     " " contents "|")))
+     (when (org-export-table-row-starts-header-p table-row info)
+       "|")
+     (cond ((equal (length contents) 0) " ")
+       (t (format "%s" contents))) "|")))

 (defun org-confluence-template (contents info)
   (let ((depth (plist-get info :with-toc)))
--
2.10.0.windows.1

[-- Attachment #2: Type: text/html, Size: 4896 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ox-confluence.el: Blank org table cells[...]
  2017-04-17  4:00 [PATCH] ox-confluence.el: Blank org table cells[...] Stephen Mackenzie
@ 2017-04-17  9:30 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-04-17  9:30 UTC (permalink / raw)
  To: Stephen Mackenzie; +Cc: emacs-orgmode

Hello,

Stephen Mackenzie <maxnbk@gmail.com> writes:

> First post..
> Disclaimer, I have no idea what I'm doing. (Don't know lisp, don't know how
> to use git format-patch correctly(?), etc.
> Fixed this for myself and wanted to try my hand at submitting it.
> If I did a terrible job, let me know and I'll try to remedy.

No, this is very good.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-17  9:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-17  4:00 [PATCH] ox-confluence.el: Blank org table cells[...] Stephen Mackenzie
2017-04-17  9:30 ` Nicolas Goaziou

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).