diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-11-06 23:07:17 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-11-06 23:07:17 +0100 |
commit | 0880fc580eedb1d2266817932165ecf3f6cbdd73 (patch) | |
tree | 362cb7cc476abfe7b6a6d1ba12de3a85581aa254 | |
parent | 7000ed9ee0c333245e78157109fb86c627ec1c29 (diff) | |
download | org-mode-0880fc580eedb1d2266817932165ecf3f6cbdd73.tar.gz |
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.
-rw-r--r-- | lisp/ox-ascii.el | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index b75012f..e83eb19 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)))))) |