Merge branch 'bugfix'

This commit is contained in:
Ihor Radchenko 2023-01-12 12:23:41 +03:00
commit d0758eabfe
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
4 changed files with 15 additions and 3 deletions

View File

@ -2382,7 +2382,9 @@ Assume point is at the beginning of the fixed-width area."
(defun org-element-fixed-width-interpreter (fixed-width _)
"Interpret FIXED-WIDTH element as Org syntax."
(let ((value (org-element-property :value fixed-width)))
(and value (replace-regexp-in-string "^" ": " value))))
(and value
(if (string-empty-p value) ":\n"
(replace-regexp-in-string "^" ": " value)))))
;;;; Horizontal Rule

View File

@ -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.

View File

@ -3099,7 +3099,7 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01"))))
(should
(equal (org-element-fixed-width-interpreter
'(fixed-width (:value "")) nil)
""))
":\n"))
;; Handle nil value.
(should-not
(org-element-fixed-width-interpreter

View File

@ -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"