forked from mirrors/org-mode
org-export-as: Fix subtree export when metadata ends right before heading
* lisp/ox.el (org-export-as): Only include first newline after heading line when the metadata is non-empty. * testing/lisp/test-ox.el (test-org-export/export-scope): Add test. Reported-by: Kaushal Modi <kaushal.modi@gmail.com> Link: https://orgmode.org/list/CAFyQvY1d=UEJ-6ZPG1X+st=fCfBAnTfgbVNhxyxH_xKcLGG4cQ@mail.gmail.com
This commit is contained in:
parent
89d13998bd
commit
a52d0f0918
|
@ -3040,7 +3040,7 @@ Return code as a string."
|
|||
;; This way, we will be able to retrieve its export
|
||||
;; options when calling
|
||||
;; `org-export--get-subtree-options'.
|
||||
(backward-char)
|
||||
(when (bolp) (backward-char))
|
||||
(narrow-to-region (point) (point-max))))
|
||||
;; Initialize communication channel with original buffer
|
||||
;; attributes, unavailable in its copy.
|
||||
|
|
|
@ -1113,6 +1113,16 @@ Text"
|
|||
(org-export-as (org-test-default-backend)
|
||||
'subtree nil nil
|
||||
'(:with-planning t :with-properties t)))))
|
||||
(should
|
||||
(equal ""
|
||||
(org-test-with-temp-text "
|
||||
* H
|
||||
:PROPERTIES:
|
||||
:A: 1
|
||||
:END:<point>
|
||||
* H2"
|
||||
(org-export-as (org-test-default-backend)
|
||||
'subtree))))
|
||||
;; Visible.
|
||||
(should
|
||||
(equal "* H1\n"
|
||||
|
|
Loading…
Reference in New Issue