From 91749491eb95cf1088fbe5a479eb30816478dba7 Mon Sep 17 00:00:00 2001 Message-Id: <91749491eb95cf1088fbe5a479eb30816478dba7.1637670436.git.yantar92@gmail.com> From: Ihor Radchenko Date: Tue, 23 Nov 2021 20:25:41 +0800 Subject: [PATCH] org-element: Fix org-element-timestamp-parser for incomplete ranges * lisp/org-element.el (org-element-timestamp-parser): Use more strict regexp to match second timestamp in timestamp--timestamp range. Fixes https://list.orgmode.org/orgmode/87tuh88kjv.fsf@localhost/ --- lisp/org-element.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index b47fba9eb..b40ff2d33 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -3900,7 +3900,9 @@ (defun org-element-timestamp-parser () (activep (eq (char-after) ?<)) (raw-value (progn - (looking-at "\\([<[]\\(%%\\)?.*?\\)[]>]\\(?:--\\([<[].*?[]>]\\)\\)?") + (looking-at (concat "\\([<[]\\(%%\\)?.*?\\)[]>]\\(?:--\\(" + org-ts-regexp-both + "\\)\\)?")) (match-string-no-properties 0))) (date-start (match-string-no-properties 1)) (date-end (match-string 3)) -- 2.32.0