ソースを参照

org-element-export-snippet-parser: Fix snippets without ending @@

* lisp/org-element.el (org-element-export-snippet-parser): Do not
recognise snippets without closing @@ as empty "@@backend:" snippets.

Example:
@@html:fo aksjdaksjd ajs d

askdjas aksj daj sao@@

Reported in
https://github.com/lucasvreis/org-parser/blob/master/SPEC.org#export-snippets
Ihor Radchenko 3 年 前
コミット
96529e933b
1 ファイル変更3 行追加2 行削除
  1. 3 2
      lisp/org-element.el

+ 3 - 2
lisp/org-element.el

@@ -3200,8 +3200,9 @@ Assume point is at the beginning of the snippet."
       (when (and (looking-at "@@\\([-A-Za-z0-9]+\\):")
 		 (setq contents-end
 		       (save-match-data (goto-char (match-end 0))
-					(re-search-forward "@@" nil t)
-					(match-beginning 0))))
+                                        (when
+					    (re-search-forward "@@" nil t)
+					  (match-beginning 0)))))
 	(let* ((begin (match-beginning 0))
 	       (back-end (match-string-no-properties 1))
 	       (value (buffer-substring-no-properties