Merge branch 'maint'
This commit is contained in:
commit
0b13ec8c1b
|
@ -3514,7 +3514,7 @@ CDR a plist of keywords and values."
|
||||||
output)
|
output)
|
||||||
(unless (bobp)
|
(unless (bobp)
|
||||||
(while (and (not (bobp)) (progn (forward-line -1) (looking-at key-re)))
|
(while (and (not (bobp)) (progn (forward-line -1) (looking-at key-re)))
|
||||||
(let* ((raw-kwd (upcase (or (match-string 2) (match-string 1))))
|
(let* ((raw-kwd (upcase (match-string 1)))
|
||||||
;; Apply translation to RAW-KWD. From there, KWD is
|
;; Apply translation to RAW-KWD. From there, KWD is
|
||||||
;; the official keyword.
|
;; the official keyword.
|
||||||
(kwd (or (cdr (assoc raw-kwd trans-list)) raw-kwd))
|
(kwd (or (cdr (assoc raw-kwd trans-list)) raw-kwd))
|
||||||
|
@ -3528,7 +3528,7 @@ CDR a plist of keywords and values."
|
||||||
;; value. Maybe parse it.
|
;; value. Maybe parse it.
|
||||||
(dual-value
|
(dual-value
|
||||||
(and (member kwd duals)
|
(and (member kwd duals)
|
||||||
(let ((sec (org-match-string-no-properties 3)))
|
(let ((sec (org-match-string-no-properties 2)))
|
||||||
(if (or (not sec) (not (member kwd parsed))) sec
|
(if (or (not sec) (not (member kwd parsed))) sec
|
||||||
(org-element-parse-secondary-string sec restrict)))))
|
(org-element-parse-secondary-string sec restrict)))))
|
||||||
;; Attribute a property name to KWD.
|
;; Attribute a property name to KWD.
|
||||||
|
|
|
@ -154,6 +154,40 @@ Some other text
|
||||||
|
|
||||||
;;; Test Parsers
|
;;; Test Parsers
|
||||||
|
|
||||||
|
;;;; Affiliated Keywords
|
||||||
|
|
||||||
|
(ert-deftest test-org-element/affiliated-keywords-parser ()
|
||||||
|
"Test affiliated keywords parsing."
|
||||||
|
;; Read simple keywords.
|
||||||
|
(should
|
||||||
|
(equal "para"
|
||||||
|
(org-element-property
|
||||||
|
:name
|
||||||
|
(org-test-with-temp-text "#+NAME: para\nParagraph"
|
||||||
|
(org-element-at-point)))))
|
||||||
|
;; Parse multiple keywords.
|
||||||
|
(should
|
||||||
|
(equal
|
||||||
|
'("line1" "line2")
|
||||||
|
(org-element-property
|
||||||
|
:attr_ascii
|
||||||
|
(org-test-with-temp-text
|
||||||
|
"#+ATTR_ASCII: line1\n#+ATTR_ASCII: line2\nParagraph"
|
||||||
|
(org-element-at-point)))))
|
||||||
|
;; Parse "parsed" keywords.
|
||||||
|
(should
|
||||||
|
(equal
|
||||||
|
'("caption")
|
||||||
|
(org-test-with-temp-text "#+CAPTION: caption\nParagraph"
|
||||||
|
(car (org-element-property :caption (org-element-at-point))))))
|
||||||
|
;; Parse dual keywords.
|
||||||
|
(should
|
||||||
|
(equal
|
||||||
|
'(("long") "short")
|
||||||
|
(org-test-with-temp-text "#+CAPTION[short]: long\nParagraph"
|
||||||
|
(org-element-property :caption (org-element-at-point))))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Babel Call
|
;;;; Babel Call
|
||||||
|
|
||||||
(ert-deftest test-org-element/babel-call-parser ()
|
(ert-deftest test-org-element/babel-call-parser ()
|
||||||
|
@ -1636,7 +1670,7 @@ Outside list"
|
||||||
|
|
||||||
;;; Test Interpreters.
|
;;; Test Interpreters.
|
||||||
|
|
||||||
(ert-deftest test-org-element/interpret-affiliated-keywords ()
|
(ert-deftest test-org-element/affiliated-keywords-interpreter ()
|
||||||
"Test if affiliated keywords are correctly interpreted."
|
"Test if affiliated keywords are correctly interpreted."
|
||||||
;; Interpret simple keywords.
|
;; Interpret simple keywords.
|
||||||
(should
|
(should
|
||||||
|
|
Loading…
Reference in New Issue