forked from mirrors/org-mode
org-element-dynamic-block-open-re-nogroup: Demand block name
* lisp/org-element.el (org-element-dynamic-block-open-re-nogroup): Fix inconsistency with `org-element-dynamic-block-open-re' - block name is mandatory. * testing/lisp/test-org-element.el (test-org-element/dynamic-block-parser): Add test.
This commit is contained in:
parent
1d585a1b38
commit
20162f5a5c
|
@ -189,7 +189,7 @@ Parameters are in match group 2.")
|
||||||
|
|
||||||
(defconst org-element-dynamic-block-open-re-nogroup
|
(defconst org-element-dynamic-block-open-re-nogroup
|
||||||
(rx line-start (0+ (any ?\s ?\t))
|
(rx line-start (0+ (any ?\s ?\t))
|
||||||
"#+BEGIN:" (0+ (any ?\s ?\t)))
|
"#+BEGIN:" (0+ (any ?\s ?\t)) word)
|
||||||
"Regexp matching the opening line of a dynamic block.")
|
"Regexp matching the opening line of a dynamic block.")
|
||||||
|
|
||||||
(defconst org-element-headline-re
|
(defconst org-element-headline-re
|
||||||
|
|
|
@ -1282,7 +1282,11 @@ Some other text
|
||||||
;; Handle non-empty blank line at the end of buffer.
|
;; Handle non-empty blank line at the end of buffer.
|
||||||
(should
|
(should
|
||||||
(org-test-with-temp-text "#+BEGIN: myblock :param val1\nC\n#+END:\n "
|
(org-test-with-temp-text "#+BEGIN: myblock :param val1\nC\n#+END:\n "
|
||||||
(= (org-element-property :end (org-element-at-point)) (point-max)))))
|
(= (org-element-property :end (org-element-at-point)) (point-max))))
|
||||||
|
;; Block name is mandatory.
|
||||||
|
(should-not
|
||||||
|
(org-test-with-temp-text "#+BEGIN:\n\n#+END:\n"
|
||||||
|
(org-element-type-p (org-element-at-point) 'dynamic-block))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Entity
|
;;;; Entity
|
||||||
|
|
Loading…
Reference in New Issue