emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stephen Mackenzie <maxnbk@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] ox-confluence.el: Blank org table cells[...]
Date: Mon, 17 Apr 2017 00:00:39 -0400	[thread overview]
Message-ID: <CAAGnfC6piJySFgibMz76-Yity7bmJMm1EShBCJ--swDr0ZusUw@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2017-04-17  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-17  4:00 Stephen Mackenzie [this message]
2017-04-17  9:30 ` [PATCH] ox-confluence.el: Blank org table cells[...] Nicolas Goaziou

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=CAAGnfC6piJySFgibMz76-Yity7bmJMm1EShBCJ--swDr0ZusUw@mail.gmail.com \
    --to=maxnbk@gmail.com \
    --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).