From 3e1bccc4a5206c2e61c41959174c76e9ba55c093 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 22 Sep 2015 21:32:07 +0200 Subject: [PATCH] ox-md: Fix blank lines insertion in sub-lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/ox-md.el (org-md-separate-elements): In a list, when a sub-list is followed by another element, make sure it is surrounded by blank lines. Reported-by: dbitouze@wanadoo.fr (Denis Bitouzé) --- lisp/ox-md.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/ox-md.el b/lisp/ox-md.el index 919f29611..989f8bfca 100644 --- a/lisp/ox-md.el +++ b/lisp/ox-md.el @@ -116,9 +116,10 @@ Assume BACKEND is `md'." e :post-blank (if (and (eq (org-element-type e) 'paragraph) (eq (org-element-type (org-element-property :parent e)) 'item) - (eq (org-element-type (org-export-get-next-element e info)) - 'plain-list) - (not (org-export-get-previous-element e info))) + (not (org-export-get-previous-element e info)) + (let ((next (org-export-get-next-element e info))) + (and (eq (org-element-type next) 'plain-list) + (not (org-export-get-next-element next info))))) 0 1)))) ;; Return updated tree.