forked from mirrors/org-mode
org-element-export-snippet-parser: Fix when no closing @@
* lisp/org-element.el (org-element-export-snippet-parser): Return nil when there is no closing @@. * testing/lisp/test-org-element.el (test-org-element/context): Add test. Reported-by: Tom Alexander <tom@fizz.buzz> Link: https://orgmode.org/list/fb61ea28-f004-4c25-adf7-69fc55683ed4@app.fastmail.com
This commit is contained in:
parent
b89bc55867
commit
e340dde63e
|
@ -3328,13 +3328,14 @@ Assume point is at the beginning of the snippet."
|
|||
(- contents-end begin))))
|
||||
(post-blank (skip-chars-forward " \t"))
|
||||
(end (point)))
|
||||
(org-element-create
|
||||
'export-snippet
|
||||
(list :back-end backend
|
||||
:value value
|
||||
:begin begin
|
||||
:end end
|
||||
:post-blank post-blank))))))
|
||||
(when contents-end ; No match when no trailing "@@".
|
||||
(org-element-create
|
||||
'export-snippet
|
||||
(list :back-end backend
|
||||
:value value
|
||||
:begin begin
|
||||
:end end
|
||||
:post-blank post-blank)))))))
|
||||
|
||||
(defun org-element-export-snippet-interpreter (export-snippet _)
|
||||
"Interpret EXPORT-SNIPPET object as Org syntax."
|
||||
|
|
|
@ -4607,7 +4607,13 @@ Text
|
|||
(should
|
||||
(eq 'link
|
||||
(org-test-with-temp-text "* Headline :file<point>:tags: :real:tag:"
|
||||
(org-element-type (org-element-context))))))
|
||||
(org-element-type (org-element-context)))))
|
||||
;; Do not parse partial export snippets.
|
||||
(should-not
|
||||
(eq 'export-snippet
|
||||
(org-test-with-temp-text
|
||||
"<point>@@latex:\n\nparagraph\n\n@@"
|
||||
(org-element-type (org-element-context))))))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue