mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-04 22:42:59 +00:00
Merge branch 'maint'
This commit is contained in:
commit
3b8f7b42cf
|
@ -1834,8 +1834,11 @@ Assume point is at the beginning of the fixed-width area."
|
|||
(defun org-element-fixed-width-interpreter (fixed-width contents)
|
||||
"Interpret FIXED-WIDTH element as Org syntax.
|
||||
CONTENTS is nil."
|
||||
(replace-regexp-in-string
|
||||
"^" ": " (substring (org-element-property :value fixed-width) 0 -1)))
|
||||
(let ((value (org-element-property :value fixed-width)))
|
||||
(and value
|
||||
(replace-regexp-in-string
|
||||
"^" ": "
|
||||
(if (string-match "\n\\'" value) (substring value 0 -1) value)))))
|
||||
|
||||
|
||||
;;;; Horizontal Rule
|
||||
|
|
|
@ -2185,7 +2185,25 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] => 0:01"))
|
|||
(should (equal (org-test-parse-and-interpret ": Test") ": Test\n"))
|
||||
;; Preserve indentation.
|
||||
(should (equal (org-test-parse-and-interpret ": 2 blanks\n: 1 blank")
|
||||
": 2 blanks\n: 1 blank\n")))
|
||||
": 2 blanks\n: 1 blank\n"))
|
||||
;; Remove last newline character
|
||||
(should
|
||||
(equal (org-element-fixed-width-interpreter
|
||||
'(fixed-width (:value "Test\n")) nil)
|
||||
": Test"))
|
||||
(should
|
||||
(equal (org-element-fixed-width-interpreter
|
||||
'(fixed-width (:value "Test")) nil)
|
||||
": Test"))
|
||||
;; Handle empty string.
|
||||
(should
|
||||
(equal (org-element-fixed-width-interpreter
|
||||
'(fixed-width (:value "")) nil)
|
||||
""))
|
||||
;; Handle nil value.
|
||||
(should-not
|
||||
(org-element-fixed-width-interpreter
|
||||
'(fixed-width (:value nil)) nil)))
|
||||
|
||||
(ert-deftest test-org-element/horizontal-rule-interpreter ()
|
||||
"Test horizontal rule interpreter."
|
||||
|
|
Loading…
Reference in a new issue