From 0880fc580eedb1d2266817932165ecf3f6cbdd73 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 6 Nov 2017 23:07:17 +0100 Subject: [PATCH] ox-ascii: Small fix to items that do not start with a paragraph * lisp/ox-ascii.el (org-ascii-item): Use better heuristics to determine if contents should follow bullet or start a new line. Contents follow bullet when the first contributing line is a paragraph. As a consequence, the following snippet - #+html: ... This is a paragraph. is exported as - This is a paragraph. instead of - This is a paragraph. previously. --- lisp/ox-ascii.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index b75012f6e..e83eb197a 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -1485,9 +1485,18 @@ contextual information." ;; already taken care of at the paragraph level so they don't ;; interfere with indentation. (let ((contents (org-ascii--indent-string contents indentation))) - (if (and (eq (org-element-type (car (org-element-contents item))) - 'paragraph) - (not (eq list-type 'descriptive))) + ;; Determine if contents should follow the bullet or start + ;; a new line. Do the former when the first contributing + ;; element to contents is a paragraph. In descriptive lists + ;; however, contents always start a new line. + (if (and (not (eq list-type 'descriptive)) + (org-string-nw-p contents) + (eq 'paragraph + (org-element-type + (cl-some (lambda (e) + (and (org-string-nw-p (org-export-data e info)) + e)) + (org-element-contents item))))) (org-trim contents) (concat "\n" contents))))))