forked from mirrors/org-mode
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.
This commit is contained in:
parent
7000ed9ee0
commit
0880fc580e
|
@ -1485,9 +1485,18 @@ contextual information."
|
||||||
;; already taken care of at the paragraph level so they don't
|
;; already taken care of at the paragraph level so they don't
|
||||||
;; interfere with indentation.
|
;; interfere with indentation.
|
||||||
(let ((contents (org-ascii--indent-string contents indentation)))
|
(let ((contents (org-ascii--indent-string contents indentation)))
|
||||||
(if (and (eq (org-element-type (car (org-element-contents item)))
|
;; Determine if contents should follow the bullet or start
|
||||||
'paragraph)
|
;; a new line. Do the former when the first contributing
|
||||||
(not (eq list-type 'descriptive)))
|
;; 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)
|
(org-trim contents)
|
||||||
(concat "\n" contents))))))
|
(concat "\n" contents))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue